mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 05:15:59 +01:00
fixes in side pane toggling
This commit is contained in:
@@ -38,9 +38,6 @@ export default class SidePaneToggles extends BasicWidget {
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
|
||||
this.toggleSidebar('left', options.is('leftPaneVisible'));
|
||||
this.toggleSidebar('right', options.is('rightPaneVisible'));
|
||||
|
||||
this.$widget.find(".show-right-pane-button").on('click', () => this.toggleAndSave('right', true));
|
||||
this.$widget.find(".hide-right-pane-button").on('click', () => this.toggleAndSave('right', false));
|
||||
|
||||
@@ -59,16 +56,19 @@ export default class SidePaneToggles extends BasicWidget {
|
||||
}
|
||||
|
||||
async toggleAndSave(side, show) {
|
||||
this.toggleSidebar(side, show);
|
||||
|
||||
await options.save(`${side}PaneVisible`, show.toString());
|
||||
|
||||
this.toggleSidebar(side, show);
|
||||
|
||||
splitService.setupSplit(this.paneVisible.left, this.paneVisible.right);
|
||||
|
||||
this.triggerEvent('sidebarVisibilityChanged', {side, show});
|
||||
}
|
||||
|
||||
initialRenderCompleteEvent() {
|
||||
this.toggleSidebar('left', options.is('leftPaneVisible'));
|
||||
this.toggleSidebar('right', options.is('rightPaneVisible'));
|
||||
|
||||
splitService.setupSplit(this.paneVisible.left, this.paneVisible.right);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user