Commit f976078c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

prevent double note submit

parent e5502790
...@@ -25,4 +25,4 @@ ...@@ -25,4 +25,4 @@
.clear .clear
%br %br
= f.submit 'Add note', :class => "lbutton vm" = f.submit 'Add note', :class => "lbutton vm", :id => "submit_note"
...@@ -9,6 +9,15 @@ ...@@ -9,6 +9,15 @@
$('.delete-note').live('ajax:success', function() { $('.delete-note').live('ajax:success', function() {
$(this).closest('li').fadeOut(); }); $(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) - if ["issues", "projects"].include?(controller.controller_name)
:javascript :javascript
$(function(){ $(function(){
......
...@@ -6,3 +6,6 @@ ...@@ -6,3 +6,6 @@
- else - else
:plain :plain
$("#new_note").replaceWith("#{escape_javascript(render('form'))}"); $("#new_note").replaceWith("#{escape_javascript(render('form'))}");
:plain
$("#submit_note").removeAttr("disabled");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment