diff --git a/app/views/notes/_form.html.haml b/app/views/notes/_form.html.haml
index ccb159f..8eaf968 100644
--- a/app/views/notes/_form.html.haml
+++ b/app/views/notes/_form.html.haml
@@ -25,4 +25,4 @@
.clear
%br
- = f.submit 'Add note', :class => "lbutton vm"
+ = f.submit 'Add note', :class => "lbutton vm", :id => "submit_note"
diff --git a/app/views/notes/_notes.html.haml b/app/views/notes/_notes.html.haml
index 040c2f2..c93a472 100644
--- a/app/views/notes/_notes.html.haml
+++ b/app/views/notes/_notes.html.haml
@@ -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(){
diff --git a/app/views/notes/create.js.haml b/app/views/notes/create.js.haml
index 47cff1d..0af548f 100644
--- a/app/views/notes/create.js.haml
+++ b/app/views/notes/create.js.haml
@@ -6,3 +6,6 @@
- else
:plain
$("#new_note").replaceWith("#{escape_javascript(render('form'))}");
+
+:plain
+ $("#submit_note").removeAttr("disabled");
--
libgit2 0.21.2