]> source.dussan.org Git - redmine.git/commitdiff
Fixed that "Create and continue" buttons are broken by r9391 (#10675).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 19 Apr 2012 07:17:48 +0000 (07:17 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 19 Apr 2012 07:17:48 +0000 (07:17 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9442 e93f8b46-1217-0410-a6f0-8f06a7374b81

public/javascripts/application.js

index c95c34da647392fee0ca16df06760680107ea402..29c34c4eb9e5d5a21d23ec367564157c87ac794f 100644 (file)
@@ -521,13 +521,16 @@ function hideOnLoad() {
 }
 
 function addFormObserversForDoubleSubmit() {
-  $$('form[method=post]').each(function(el) {
-    Event.observe(el, 'submit', function(e) {
-      var form = Event.element(e);
-      form.select('input[type=submit]').each(function(btn) {
-        btn.disable();
+  $$('form[method=post]').each(function(form) {
+    if (!form.hasClassName('multiple-submit')) {
+      form.on('submit', function(form_submission) { 
+        if (form.getStorage().get('submitted')) {
+          form_submission.stop();
+        } else {
+          form.getStorage().set('submitted', true);
+        }
       });
-    });
+    }
   });
 }