Commit Graph

11 Commits

Author SHA1 Message Date
rgarcia
7f30d0c620 Fix doble submit specs
We have a custom implementation to avoid doble submissions which causes
some custom problems 😌

This commit should fix the following three specs
spec/features/comments/legislation_annotations_spec.rb:367
spec/features/comments/legislation_questions_spec.rb:333
spec/features/custom/probe_option_comments_spec.rb:298

One of the custom problems comes from ajax:success[1] not being
triggered, instead only ajax:complete seems to be triggered

We should remove this custom implementation and use the standard
solution provided in rails[2]

[1]
https://github.com/AyuntamientoMadrid/consul/blob/master/app/assets/java
scripts/prevent_double_submission.js.coffee#L28

[2]
https://stackoverflow.com/questions/9570912/how-to-disable-a-form-submit
-button-a-l%C3%A0-ruby-on-rails-way/9572893#9572893
2018-02-20 22:33:01 +01:00
María Checa
1c458d4be3 Added emails download views 2018-02-20 22:33:01 +01:00
Manuel Ortega
9de9a81b8c Added reference to event on the .on method('ajax:success',... 2017-10-20 14:12:31 +02:00
rgarcia
560ff7c51d does not use custom implementation to disable submit button 2017-10-13 12:40:42 +02:00
Jakub
12c28fe32d Fix double-submission prevention not working. 2015-11-26 17:14:14 +01:00
kikito
468c5c2a72 fixes two issues in prevent_double_submission.js : disabled inputs are not sent on put, and jquery each iterates over "this" 2015-09-13 22:07:45 +02:00
kikito
08dfa982eb Fixes error in double_submission button
It did not take into account that some forms can have more than 1
submit button, which made the code not include the button values in
some puts and posts.
2015-09-13 22:07:44 +02:00
David Gil
a5f05455c4 prefers :button and :submit selector to css class in selector 2015-09-10 18:42:53 +02:00
David Gil
2f5168a2bf changes default loading text to "..." 2015-09-10 18:35:48 +02:00
David Gil
a742afff9b clean code 2015-09-10 18:00:48 +02:00
David Gil
81b1549d11 prevents double submit for form buttons 2015-09-10 17:58:02 +02:00