Skip to content

Commit

Permalink
MINOR Only setting form state if form element is available in 'ss-ui-…
Browse files Browse the repository at this point in the history
…button'
  • Loading branch information
chillu committed May 8, 2011
1 parent 0b8f8a3 commit 4feae59
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions admin/javascript/ssui.core.js
Expand Up @@ -26,10 +26,12 @@
.click(function() {
var form = this.form;
// forms don't natively store the button they've been triggered with
form.clickedButton = this;
// Reset the clicked button shortly after the onsubmit handlers
// have fired on the form
setTimeout(function() {form.clickedButton = null;}, 10);
if(form) {
form.clickedButton = this;
// Reset the clicked button shortly after the onsubmit handlers
// have fired on the form
setTimeout(function() {form.clickedButton = null;}, 10);
}
});

this._super();
Expand Down

0 comments on commit 4feae59

Please sign in to comment.