does not use custom implementation to disable submit button
This commit is contained in:
@@ -22,11 +22,13 @@ App.PreventDoubleSubmission =
|
||||
|
||||
initialize: ->
|
||||
$('form').on('submit', (event) ->
|
||||
buttons = $(this).find(':button, :submit')
|
||||
App.PreventDoubleSubmission.disable_buttons(buttons)
|
||||
unless event.target.id == "new_officing_voter"
|
||||
buttons = $(this).find(':button, :submit')
|
||||
App.PreventDoubleSubmission.disable_buttons(buttons)
|
||||
).on('ajax:success', ->
|
||||
buttons = $(this).find(':button, :submit')
|
||||
App.PreventDoubleSubmission.reset_buttons(buttons)
|
||||
unless event.target.id == "new_officing_voter"
|
||||
buttons = $(this).find(':button, :submit')
|
||||
App.PreventDoubleSubmission.reset_buttons(buttons)
|
||||
)
|
||||
|
||||
false
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="small-12 medium-6 large-4 column end">
|
||||
<%= form_for @user, as: :voter, url: officing_voters_path, method: :post, remote: true do |f| %>
|
||||
<%= form_for @user, as: :voter, url: officing_voters_path,
|
||||
method: :post, remote: true,
|
||||
html: { id: "new_officing_voter" } do |f| %>
|
||||
<%= f.hidden_field :poll_id, value: poll.id %>
|
||||
<%= f.hidden_field :user_id, value: @user.id %>
|
||||
<%= f.submit t("officing.voters.show.submit"), class: "button success expanded" %>
|
||||
|
||||
Reference in New Issue
Block a user