refactored tab activation

This commit is contained in:
zadam
2020-01-19 21:12:53 +01:00
parent 1098d75ce0
commit 0760dc742b
8 changed files with 79 additions and 44 deletions

View File

@@ -81,6 +81,12 @@ class TabContext extends Component {
return this.tabId === this.tabRow.activeTabId;
}
async remove() {
await this.trigger('beforeTabRemove', {tabId: this.tabId}, true);
this.trigger('tabRemoved', {tabId: this.tabId});
}
setupClasses() {
for (const clazz of Array.from(this.$tab[0].classList)) { // create copy to safely iterate over while removing classes
if (clazz !== 'note-tab') {
@@ -123,8 +129,7 @@ class TabContext extends Component {
// FIXME trigger "noteSaved" event so that title indicator is triggered
this.eventReceived('noteSaved');
// run async
bundleService.executeRelationBundles(this.note, 'runOnNoteChange', this);
}
async saveNoteIfChanged() {