From 411d0de4a23a6683a2ca3f2e7bc671fee373c34e Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Mon, 22 Feb 2010 02:51:11 +0000 Subject: [PATCH] BUGFIX: Remove buttons from display if you load a CMS page that should have no buttons - reverts bug caused by r96551 and fixes the issue it was trying to solve. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@99553 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/LeftAndMain.js | 6 +++--- javascript/ReportAdmin_right.js | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/javascript/LeftAndMain.js b/javascript/LeftAndMain.js index 749d94fd..536a9fde 100644 --- a/javascript/LeftAndMain.js +++ b/javascript/LeftAndMain.js @@ -266,10 +266,10 @@ function ajaxActionsAtTop(formName, actionHolderName, tabName) { var actions = document.getElementsBySelector('#' + formName + ' .Actions')[0]; var holder = $(actionHolderName); + if ( holder && holder != actions ) { + holder.parentNode.removeChild(holder); + } if(actions) { - if ( holder ) { - holder.parentNode.removeChild(holder); - } actions.id = actionHolderName; actions.className = 'ajaxActions'; diff --git a/javascript/ReportAdmin_right.js b/javascript/ReportAdmin_right.js index 31a6bbe8..42879eb7 100755 --- a/javascript/ReportAdmin_right.js +++ b/javascript/ReportAdmin_right.js @@ -1,6 +1,5 @@ - Behaviour.register({ - '#Form_EditForm' : { + 'body.ReportAdmin #Form_EditForm' : { initialise : function() { this.openTab = null; this.prepareForm();