sidebar & widget state management WIP

This commit is contained in:
zadam
2019-08-15 10:04:03 +02:00
parent 61520bc3b3
commit 59da25ef55
9 changed files with 286 additions and 97 deletions

View File

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