mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR More events for LeftAndMain.Panel.js
This commit is contained in:
parent
a1e9c0f41e
commit
51fe1fa1ca
@ -69,11 +69,16 @@
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param Boolean TRUE to expand, FALSE to collapse.
|
||||
*/
|
||||
togglePanel: function(bool) {
|
||||
this.trigger('beforetoggle.sspanel', bool);
|
||||
this.trigger(bool ? 'beforeexpand' : 'beforecollapse');
|
||||
|
||||
this.toggleClass('collapsed', !bool);
|
||||
var newWidth = bool ? this.getWidthExpanded() : this.getWidthCollapsed();
|
||||
|
||||
this.trigger('beforetoggle');
|
||||
this.width(newWidth); // the content panel width always stays in "expanded state" to avoid floating elements
|
||||
this.find('.toggle-collapse')[bool ? 'show' : 'hide']();
|
||||
this.find('.toggle-expand')[bool ? 'hide' : 'show']();
|
||||
@ -88,7 +93,8 @@
|
||||
// Save collapsed state in cookie
|
||||
if($.cookie && this.attr('id')) $.cookie('cms-panel-collapsed-' + this.attr('id'), !bool, {path: '/', expires: 31});
|
||||
|
||||
this.trigger('toggle');
|
||||
this.trigger('toggle', bool);
|
||||
this.trigger(bool ? 'expand' : 'collapse');
|
||||
},
|
||||
|
||||
expandPanel: function(force) {
|
||||
|
Loading…
Reference in New Issue
Block a user