Permalink
Browse files

Handle data-confirm attributes added by submit_tag, submit_image_tag …

…and others
  • Loading branch information...
1 parent 967bc9b commit d57e7a2219f57fc287b270762c58a45f16549aac @twalpole committed May 4, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 vendor/assets/javascripts/prototype_ujs.js
@@ -161,7 +161,12 @@
}
});
- document.on("click", "form input[type=submit], form button[type=submit], form button:not([type])", function(event, button) {
+ document.on("click", "form input[type=submit], form input[type=image], form button[type=submit], form button:not([type])", function(event, button) {
+ if (!allowAction(button)){
+ event.stop();
+ return false;
+ }
+
// register the pressed submit button
event.findElement('form').store('rails:submit-button', button.name || false);
});

0 comments on commit d57e7a2

Please sign in to comment.