Merge pull request #3780 from phptek/centre-pane-expand

FIX: Expands the CMS' centre-pane when collapsed and it's clicked.
This commit is contained in:
Loz Calver 2015-01-14 09:13:43 +00:00
commit dae4de1169

View File

@ -1,12 +1,12 @@
(function($) { (function($) {
$.entwine('ss', function($){ $.entwine('ss', function($) {
// setup jquery.entwine // setup jquery.entwine
$.entwine.warningLevel = $.entwine.WARN_LEVEL_BESTPRACTISE; $.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: * A panel consists of the following parts:
* - Container div: The outer element, with class ".cms-panel" * - 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. // Set panel width same as the content panel it contains. Assumes the panel has overflow: hidden.
this.setWidthExpanded(this.find('.cms-panel-content').innerWidth()); 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'); var collapsedContent = this.find('.cms-panel-content-collapsed');
this.setWidthCollapsed(collapsedContent.length ? collapsedContent.innerWidth() : this.find('.toggle-expand').innerWidth()); this.setWidthCollapsed(collapsedContent.length ? collapsedContent.innerWidth() : this.find('.toggle-expand').innerWidth());
@ -134,5 +134,12 @@
return false; 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)); }(jQuery));