mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 22:05:44 +01:00
sidebar & widget state management WIP
This commit is contained in:
@@ -38,14 +38,27 @@ class Sidebar {
|
||||
this.$hideSidebarButton.click(() => {
|
||||
this.$sidebar.hide();
|
||||
this.$showSideBarButton.show();
|
||||
this.ctx.stateChanged();
|
||||
});
|
||||
|
||||
this.$showSideBarButton.click(() => {
|
||||
this.$sidebar.show();
|
||||
this.$showSideBarButton.hide();
|
||||
this.ctx.stateChanged();
|
||||
});
|
||||
}
|
||||
|
||||
isVisible() {
|
||||
return this.$sidebar.is(":visible");
|
||||
}
|
||||
|
||||
getSidebarState() {
|
||||
return {
|
||||
visible: this.isVisible(),
|
||||
widgets: this.widgets.map(w => w.getWidgetState())
|
||||
}
|
||||
}
|
||||
|
||||
async noteLoaded() {
|
||||
this.widgets = [];
|
||||
this.$widgets.empty();
|
||||
|
||||
Reference in New Issue
Block a user