2020-02-06 05:08:45 +08:00
|
|
|
import options from "../services/options.js";
|
2020-02-08 05:19:35 +08:00
|
|
|
import FlexContainer from "./flex_container.js";
|
2020-02-05 05:46:17 +08:00
|
|
|
|
2020-02-08 05:19:35 +08:00
|
|
|
export default class SidePaneContainer extends FlexContainer {
|
2020-02-17 01:11:32 +08:00
|
|
|
constructor(parent, side, widgetFactories) {
|
|
|
|
super(parent, {id: side + '-pane', 'flex-direction': 'column', 'height': '100%'}, widgetFactories);
|
2020-02-05 05:46:17 +08:00
|
|
|
|
|
|
|
this.side = side;
|
|
|
|
}
|
|
|
|
|
2020-02-09 04:54:39 +08:00
|
|
|
isEnabled() {
|
|
|
|
return super.isEnabled() && options.is(this.side + 'PaneVisible');
|
|
|
|
}
|
|
|
|
|
2020-02-17 02:21:17 +08:00
|
|
|
handleEvent(name, data) {
|
2020-02-05 05:46:17 +08:00
|
|
|
if (options.is(this.side + 'PaneVisible')) {
|
2020-02-17 02:21:17 +08:00
|
|
|
super.handleEvent(name, data);
|
2020-02-05 05:46:17 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-17 02:23:49 +08:00
|
|
|
sidebarVisibilityChangedEvent({side, show}) {
|
2020-02-05 05:46:17 +08:00
|
|
|
if (this.side === side) {
|
|
|
|
this.toggle(show);
|
|
|
|
|
2020-02-17 02:21:17 +08:00
|
|
|
this.handleEvent('lazyLoaded');
|
2020-02-05 05:46:17 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|