fixes two issues in prevent_double_submission.js : disabled inputs are not sent on put, and jquery each iterates over "this"
This commit is contained in:
@@ -1,14 +1,18 @@
|
||||
App.PreventDoubleSubmission =
|
||||
disable_button: (buttons) ->
|
||||
buttons.each (button)->
|
||||
unless button.hasClass('disabled')
|
||||
loading = button.data('loading') ? '...'
|
||||
button.addClass('disabled').attr('disabled', 'disabled')
|
||||
button.data('text', button.val())
|
||||
button.val(loading)
|
||||
disable_buttons: (buttons) ->
|
||||
setTimeout ->
|
||||
buttons.each ->
|
||||
button = $(this)
|
||||
unless button.hasClass('disabled')
|
||||
loading = button.data('loading') ? '...'
|
||||
button.addClass('disabled').attr('disabled', 'disabled')
|
||||
button.data('text', button.val())
|
||||
button.val(loading)
|
||||
, 1
|
||||
|
||||
reset_button: (buttons) ->
|
||||
buttons.each (button)->
|
||||
reset_buttons: (buttons) ->
|
||||
buttons.each ->
|
||||
button = $(this)
|
||||
if button.hasClass('disabled')
|
||||
button_text = button.data('text')
|
||||
button.removeClass('disabled').attr('disabled', null)
|
||||
|
||||
Reference in New Issue
Block a user