events for updating title (no saving yet)

This commit is contained in:
zadam
2020-01-19 18:05:06 +01:00
parent 44dc3c28de
commit 8da094cd3c
12 changed files with 116 additions and 73 deletions

View File

@@ -508,6 +508,17 @@ export default class TabRowWidget extends BasicWidget {
tabEl.querySelector('.note-tab-title').textContent = tabProperties.title;
}
getTabById(tabId) {
return this.$widget.find(`[data-tab-id='${tabId}']`);
}
noteTitleChangedListener({title, noteId}) {
this.appContext.getTabContexts()
.filter(tc => tc.note && tc.note.noteId === noteId)
.map(tc => this.getTabById(tc.tabId))
.forEach($el => $el.find('.note-tab-title').text(title));
}
cleanUpPreviouslyDraggedTabs() {
this.tabEls.forEach((tabEl) => tabEl.classList.remove('note-tab-was-just-dragged'));
}