summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-19 07:17:48 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-19 07:17:48 +0000
commitd856e62ccfbcf3d4953fe365292a5d9248961ec2 (patch)
treed073298e47785c74b2904f776dce7fa085df2211
parent143c29d8e175893f10ab2b1aa293f7e9ada8439c (diff)
downloadredmine-d856e62ccfbcf3d4953fe365292a5d9248961ec2.tar.gz
redmine-d856e62ccfbcf3d4953fe365292a5d9248961ec2.zip
Fixed that "Create and continue" buttons are broken by r9391 (#10675).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9442 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--public/javascripts/application.js15
1 files 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);
+ }
});
- });
+ }
});
}