mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
progress
This commit is contained in:
@@ -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() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user