prevent double note submit
This commit is contained in:
parent
74a89d9ed6
commit
2daa6161fd
3 changed files with 13 additions and 1 deletions
|
@ -25,4 +25,4 @@
|
|||
|
||||
.clear
|
||||
%br
|
||||
= f.submit 'Add note', :class => "lbutton vm"
|
||||
= f.submit 'Add note', :class => "lbutton vm", :id => "submit_note"
|
||||
|
|
|
@ -9,6 +9,15 @@
|
|||
$('.delete-note').live('ajax:success', function() {
|
||||
$(this).closest('li').fadeOut(); });
|
||||
|
||||
$("#new_note").live("ajax:before", function(){
|
||||
$("#submit_note").attr("disabled", "disabled");
|
||||
})
|
||||
|
||||
$("#new_note").live("ajax:complete", function(){
|
||||
$("#submit_note").removeAttr("disabled");
|
||||
})
|
||||
|
||||
|
||||
- if ["issues", "projects"].include?(controller.controller_name)
|
||||
:javascript
|
||||
$(function(){
|
||||
|
|
|
@ -6,3 +6,6 @@
|
|||
- else
|
||||
:plain
|
||||
$("#new_note").replaceWith("#{escape_javascript(render('form'))}");
|
||||
|
||||
:plain
|
||||
$("#submit_note").removeAttr("disabled");
|
||||
|
|
Loading…
Reference in a new issue