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

31 lines
732 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-27 17:03:14 +08:00
constructor(side) {
super('column');
this.side = side;
2020-02-27 17:03:14 +08:00
this.id(side + '-pane');
this.css('height', '100%');
}
isEnabled() {
return super.isEnabled() && options.is(this.side + 'PaneVisible');
}
2020-02-17 02:21:17 +08:00
handleEvent(name, data) {
if (options.is(this.side + 'PaneVisible')) {
2020-02-17 02:21:17 +08:00
super.handleEvent(name, data);
}
}
2020-02-17 02:23:49 +08:00
sidebarVisibilityChangedEvent({side, show}) {
if (this.side === side) {
this.toggle(show);
2020-02-17 02:21:17 +08:00
this.handleEvent('lazyLoaded');
}
}
}