mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00: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) {
|
togglePanel: function(bool) {
|
||||||
|
this.trigger('beforetoggle.sspanel', bool);
|
||||||
|
this.trigger(bool ? 'beforeexpand' : 'beforecollapse');
|
||||||
|
|
||||||
this.toggleClass('collapsed', !bool);
|
this.toggleClass('collapsed', !bool);
|
||||||
var newWidth = bool ? this.getWidthExpanded() : this.getWidthCollapsed();
|
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.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-collapse')[bool ? 'show' : 'hide']();
|
||||||
this.find('.toggle-expand')[bool ? 'hide' : 'show']();
|
this.find('.toggle-expand')[bool ? 'hide' : 'show']();
|
||||||
@ -88,7 +93,8 @@
|
|||||||
// Save collapsed state in cookie
|
// Save collapsed state in cookie
|
||||||
if($.cookie && this.attr('id')) $.cookie('cms-panel-collapsed-' + this.attr('id'), !bool, {path: '/', expires: 31});
|
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) {
|
expandPanel: function(force) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user