Sha256: 661b448910127d7bdf5caba33ed8690248d056e71dcf336bac0d75143db0daad

Contents?: true

Size: 731 Bytes

Versions: 19

Compression:

Stored size: 731 Bytes

Contents

# These next three methods hijack jquery_ujs data-confirm and do it our own way with a double click confirm

if <%= !!EffectiveBootstrap.use_custom_data_confirm %> && $.rails
  $(document).on 'confirm', (event) ->
    $obj = $(event.target)

    if $obj.data('confirmed')
      true
    else
      $obj.data('confirm-original', $obj.html())
      $obj.html($obj.data('confirm'))
      $obj.data('confirmed', true)
      setTimeout(
        (->
          $obj.data('confirmed', false)
          $obj.html($obj.data('confirm-original'))
        )
        , 4000)
      false # don't show the confirmation dialog

  $.rails.confirm = (message) -> true 
  $(document).on 'confirm:complete', (event) -> $(event.target).data('confirmed')

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
effective_bootstrap-0.5.16 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.5.15 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.5.14 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.5.13 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.5.12 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.5.11 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.5.10 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.5.9 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.5.8 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.5.7 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.5.6 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.5.5 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.5.4 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.5.3 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.5.2 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.5.1 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.5.0 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.4.8 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
effective_bootstrap-0.4.7 app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb