does not use custom implementation to disable submit button

This commit is contained in:
rgarcia
2017-10-13 12:40:42 +02:00
parent 1d59dcac7c
commit 560ff7c51d
2 changed files with 9 additions and 5 deletions

View File

@@ -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

View File

@@ -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" %>