mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-09 17:52:32 +08:00
28 lines
770 B
JavaScript
28 lines
770 B
JavaScript
import options from "../services/options.js";
|
|
import FlexContainer from "./flex_container.js";
|
|
|
|
export default class SidePaneContainer extends FlexContainer {
|
|
constructor(parent, side, widgetFactories) {
|
|
super(parent, {id: side + '-pane', 'flex-direction': 'column', 'height': '100%'}, widgetFactories);
|
|
|
|
this.side = side;
|
|
}
|
|
|
|
isEnabled() {
|
|
return super.isEnabled() && options.is(this.side + 'PaneVisible');
|
|
}
|
|
|
|
handleEvent(name, data) {
|
|
if (options.is(this.side + 'PaneVisible')) {
|
|
super.handleEvent(name, data);
|
|
}
|
|
}
|
|
|
|
sidebarVisibilityChangedEvent({side, show}) {
|
|
if (this.side === side) {
|
|
this.toggle(show);
|
|
|
|
this.handleEvent('lazyLoaded');
|
|
}
|
|
}
|
|
} |