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