From 4f48d1b4dd414e6a190bd9264186f8b6811694e5 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 19 Apr 2012 07:19:30 +0000 Subject: [PATCH] Merged r9442 from trunk. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.4-stable@9443 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- public/javascripts/application.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/public/javascripts/application.js b/public/javascripts/application.js index c95c34da6..29c34c4eb 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -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); + } }); - }); + } }); } -- 2.39.5