FIX: Expands the CMS' centre-pane when collapsed and it's clicked.

This commit is contained in:
Russell Michell 2015-01-09 17:22:28 +13:00
parent 146b4689b8
commit ef237f69cc

View File

@ -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));