From 80a08aab60abec2bc07fb12082831bffb7ac7467 Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Thu, 2 Feb 2012 13:12:08 +1300 Subject: [PATCH] MINOR Collapsing filter breaks the main navigation (SSF-108) --- admin/javascript/LeftAndMain.Panel.js | 43 ++++++++++++++------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/admin/javascript/LeftAndMain.Panel.js b/admin/javascript/LeftAndMain.Panel.js index b035879d6..1adaef9b9 100644 --- a/admin/javascript/LeftAndMain.Panel.js +++ b/admin/javascript/LeftAndMain.Panel.js @@ -92,28 +92,29 @@ togglePanel: function(bool) { - //apply or unapply the flyout formatting - $('.cms-menu-list').children('li').each(function(){ - if (bool) { //expand - $(this).children('ul').each(function() { - $(this).removeClass('collapsed-flyout'); - if ($(this).data('collapse')) { - $(this).removeData('collapse'); - $(this).addClass('collapse'); - } - }); - } else { //collapse - $(this).children('ul').each(function() { - $(this).addClass('collapsed-flyout'); - $(this).hasClass('collapse'); - $(this).removeClass('collapse'); - $(this).data('collapse', true); - }); - } - }); - - this.toggleFlyoutState(bool); + //apply or unapply the flyout formatting, should only apply to cms-menu-list when the current collapsed panal is the cms menu. + if($(this).attr('id') == 'cms-menu'){ + $('.cms-menu-list').children('li').each(function(){ + if (bool) { //expand + $(this).children('ul').each(function() { + $(this).removeClass('collapsed-flyout'); + if ($(this).data('collapse')) { + $(this).removeData('collapse'); + $(this).addClass('collapse'); + } + }); + } else { //collapse + $(this).children('ul').each(function() { + $(this).addClass('collapsed-flyout'); + $(this).hasClass('collapse'); + $(this).removeClass('collapse'); + $(this).data('collapse', true); + }); + } + }); + this.toggleFlyoutState(bool); + } this.toggleClass('collapsed', !bool); var newWidth = bool ? this.getWidthExpanded() : this.getWidthCollapsed();