From ef237f69cca4e1f3ac90c15476c9c3e5db5c2c83 Mon Sep 17 00:00:00 2001 From: Russell Michell Date: Fri, 9 Jan 2015 17:22:28 +1300 Subject: [PATCH] FIX: Expands the CMS' centre-pane when collapsed and it's clicked. --- admin/javascript/LeftAndMain.Panel.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/admin/javascript/LeftAndMain.Panel.js b/admin/javascript/LeftAndMain.Panel.js index 603bc5126..e1ef15cc6 100644 --- a/admin/javascript/LeftAndMain.Panel.js +++ b/admin/javascript/LeftAndMain.Panel.js @@ -1,12 +1,12 @@ (function($) { - $.entwine('ss', function($){ - + $.entwine('ss', function($) { + // setup jquery.entwine $.entwine.warningLevel = $.entwine.WARN_LEVEL_BESTPRACTISE; /** - * Hoizontal collapsible panel. Generic enough to work with CMS menu as well as various "filter" panels. + * Horizontal collapsible panel. Generic enough to work with CMS menu as well as various "filter" panels. * * A panel consists of the following parts: * - Container div: The outer element, with class ".cms-panel" @@ -45,7 +45,7 @@ // Set panel width same as the content panel it contains. Assumes the panel has overflow: hidden. this.setWidthExpanded(this.find('.cms-panel-content').innerWidth()); - // Assumes the collasped width is indicated by the toggle, or by an optional collapsed view + // Assumes the collapsed width is indicated by the toggle, or by an optionally collapsed view var collapsedContent = this.find('.cms-panel-content-collapsed'); this.setWidthCollapsed(collapsedContent.length ? collapsedContent.innerWidth() : this.find('.toggle-expand').innerWidth()); @@ -134,5 +134,12 @@ return false; } }); + + $('.cms-content-tools.collapsed').entwine({ + // Expand CMS' centre pane, when the pane itself is clicked somewhere + onclick: function(e) { + $('.cms-panel .toggle-expand').trigger('click'); + } + }); }); }(jQuery));