This commit is contained in:
zadam
2020-01-28 21:54:28 +01:00
parent 9301679707
commit 368d3b1b97
15 changed files with 76 additions and 96 deletions

View File

@@ -24,6 +24,10 @@ export default class TabAwareWidget extends BasicWidget {
return this.note && this.note.noteId;
}
get notePath() {
return this.tabContext && this.tabContext.notePath;
}
tabNoteSwitchedListener({tabId}) {
if (this.isTab(tabId)) {
this.noteSwitched();
@@ -39,20 +43,26 @@ export default class TabAwareWidget extends BasicWidget {
}
refresh() {
if (this.tabContext && this.tabContext.note) {
if (this.note) {
this.toggle(true);
this.refreshWithNote(this.tabContext.note, this.tabContext.notePath);
this.refreshWithNote(this.note, this.notePath);
}
else {
this.toggle(false);
}
}
refreshWithNote(note) {}
refreshWithNote(note, notePath) {}
activeTabChangedListener() {
this.tabContext = this.appContext.getActiveTabContext();
this.activeTabChanged();
}
notesReloadedListener({loadResults}) {
if (loadResults.isNoteReloaded(this.noteId, this.componentId)) {
this.refreshWithNote(this.note, this.notePath);
}
}
}