trilium/src/public/javascripts/widgets/side_pane_container.js

28 lines
803 B
JavaScript
Raw Normal View History

import options from "../services/options.js";
2020-02-08 05:19:35 +08:00
import FlexContainer from "./flex_container.js";
2020-02-08 05:19:35 +08:00
export default class SidePaneContainer extends FlexContainer {
2020-02-15 16:43:47 +08:00
constructor(appContext, parent, side, widgetFactories) {
super(appContext, parent, {id: side + '-pane', 'flex-direction': 'column', 'height': '100%'}, widgetFactories);
this.side = side;
}
isEnabled() {
return super.isEnabled() && options.is(this.side + 'PaneVisible');
}
2020-02-13 03:31:31 +08:00
eventReceived(name, data) {
if (options.is(this.side + 'PaneVisible')) {
2020-02-13 03:31:31 +08:00
super.eventReceived(name, data);
}
}
sidebarVisibilityChangedListener({side, show}) {
if (this.side === side) {
this.toggle(show);
this.eventReceived('lazyLoaded');
}
}
}