This commit is contained in:
zadam
2020-01-18 18:01:16 +01:00
parent b25c1d6fa8
commit b00a9f4415
12 changed files with 91 additions and 102 deletions

View File

@@ -1,13 +1,21 @@
import BasicWidget from "./basic_widget.js";
export default class TabAwareWidget extends BasicWidget {
constructor(appContext, tabContext = null) {
super(appContext);
setTabContext(tabContext) {
/** @var {TabContext} */
this.tabContext = tabContext;
this.eventReceived('tabNoteSwitched', {tabId: this.tabContext.tabId});
}
tabNoteSwitchedListener({tabId}) {
if (this.tabContext && tabId === this.tabContext.tabId) {
this.noteSwitched();
}
}
noteSwitched() {}
// to override
activeTabChanged() {}