From 4feae5939191697ff0f8cb95f35924500dbca342 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 8 May 2011 23:35:14 +1200 Subject: [PATCH] MINOR Only setting form state if form element is available in 'ss-ui-button' --- admin/javascript/ssui.core.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/admin/javascript/ssui.core.js b/admin/javascript/ssui.core.js index 1e3f71378b0..0de55545d7a 100644 --- a/admin/javascript/ssui.core.js +++ b/admin/javascript/ssui.core.js @@ -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();