Skip to content

Commit

Permalink
Handle data-confirm attributes added by submit_tag, submit_image_tag …
Browse files Browse the repository at this point in the history
…and others
  • Loading branch information
twalpole committed May 4, 2012
1 parent 967bc9b commit d57e7a2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vendor/assets/javascripts/prototype_ujs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit d57e7a2

Please sign in to comment.