mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
f97804bbe2
commit
72985b6f42
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user