From 1571d3542d237ed2958711f0254013d5859f6642 Mon Sep 17 00:00:00 2001 From: Kirk Mayo Date: Mon, 21 Jan 2013 12:56:02 +1300 Subject: [PATCH] BUG Only use $.button in onunmatch if init'ed (fixes #8181) --- javascript/CMSMain.EditForm.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/javascript/CMSMain.EditForm.js b/javascript/CMSMain.EditForm.js index 4bb5a950..ecda62ed 100644 --- a/javascript/CMSMain.EditForm.js +++ b/javascript/CMSMain.EditForm.js @@ -321,8 +321,10 @@ this._super(e); }, onunmatch: function(e) { - this.find('button[name=action_save]').button('option', 'showingAlternate', false); - this.find('button[name=action_publish]').button('option', 'showingAlternate', false); + var saveButton = this.find('button[name=action_save]'); + if(saveButton.data('button')) saveButton('option', 'showingAlternate', false); + var publishButton = this.find('button[name=action_publish]'); + if(publishButton.data('button')) publishButton('option', 'showingAlternate', false); this._super(e); } });