fixes in side pane toggling

This commit is contained in:
zadam
2020-03-01 20:11:40 +01:00
parent 9c631e4398
commit 4e0e2e8926
3 changed files with 7 additions and 15 deletions

View File

@@ -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);
}
}