MINOR Artificially triggering onsubmit event on CMS form buttons rather than calling submitForm() method, in order to give forms like .cms-add-form the option to overload its behaviour

This commit is contained in:
Ingo Schommer 2012-04-05 22:12:00 +02:00
parent f97804bbe2
commit 72985b6f42

View File

@ -141,8 +141,8 @@
*
* Suppress submission unless it is handled through ajaxSubmit().
*/
onsubmit: function(e) {
this.parents('.cms-content').submitForm(this);
onsubmit: function(e, button) {
this.parents('.cms-content').submitForm(this, button);
return false;
},
@ -179,7 +179,7 @@
* Function: onclick
*/
onclick: function(e) {
$('.cms-content').submitForm(this.parents('form'), this);
this.parents('form').trigger('submit', [this]);
e.preventDefault();
return false;
}