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-27 17:03:14 +08:00
|
|
|
constructor(side) {
|
|
|
|
super('column');
|
2020-02-05 05:46:17 +08:00
|
|
|
|
|
|
|
this.side = side;
|
2020-02-27 17:03:14 +08:00
|
|
|
|
|
|
|
this.id(side + '-pane');
|
|
|
|
this.css('height', '100%');
|
2020-02-05 05:46:17 +08:00
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|