Skip to content
This repository
Browse code

MINOR Artificially triggering onsubmit event on CMS form buttons rath…

…er than calling submitForm() method, in order to give forms like .cms-add-form the option to overload its behaviour
  • Loading branch information...
commit 72985b6f42d51844c0bed63a14bad00b18a6a76c 1 parent f97804b
Ingo Schommer authored April 05, 2012

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  admin/javascript/LeftAndMain.EditForm.js
6  admin/javascript/LeftAndMain.EditForm.js
@@ -141,8 +141,8 @@
141 141
 			 * 
142 142
 			 * Suppress submission unless it is handled through ajaxSubmit().
143 143
 			 */
144  
-			onsubmit: function(e) {
145  
-				this.parents('.cms-content').submitForm(this);
  144
+			onsubmit: function(e, button) {
  145
+				this.parents('.cms-content').submitForm(this, button);
146 146
 				
147 147
 				return false;
148 148
 			},
@@ -179,7 +179,7 @@
179 179
 			 * Function: onclick
180 180
 			 */
181 181
 			onclick: function(e) {
182  
-				$('.cms-content').submitForm(this.parents('form'), this);
  182
+				this.parents('form').trigger('submit', [this]);
183 183
 				e.preventDefault();
184 184
 				return false;
185 185
 			}

0 notes on commit 72985b6

Please sign in to comment.
Something went wrong with that request. Please try again.