working note type and note paths widgets

This commit is contained in:
zadam
2020-01-18 19:46:30 +01:00
parent b00a9f4415
commit 493730dff6
9 changed files with 177 additions and 157 deletions

View File

@@ -1,11 +1,11 @@
import BasicWidget from "./basic_widget.js";
export default class TabAwareWidget extends BasicWidget {
setTabContext(tabContext) {
setTabContextListener({tabContext}) {
/** @var {TabContext} */
this.tabContext = tabContext;
this.eventReceived('tabNoteSwitched', {tabId: this.tabContext.tabId});
this.noteSwitched();
}
tabNoteSwitchedListener({tabId}) {
@@ -14,10 +14,16 @@ export default class TabAwareWidget extends BasicWidget {
}
}
noteSwitched() {}
noteSwitched() {
this.refresh();
}
// to override
activeTabChanged() {}
activeTabChanged() {
this.refresh();
}
refresh() {}
activeTabChangedListener() {
this.tabContext = this.appContext.getActiveTabContext();