deleting a note will close all tabs containing the note

This commit is contained in:
zadam
2019-05-20 21:50:01 +02:00
parent aead6a44de
commit 48b4488a58
5 changed files with 27 additions and 6 deletions

View File

@@ -267,7 +267,7 @@ async function loadNote(noteId) {
async function filterTabs(noteId) {
for (const tc of tabContexts) {
if (tc.notePath && !tc.notePath.split("/").includes(noteId)) {
await tabRow.removeTab(tc.tab);
await tabRow.removeTab(tc.$tab[0]);
}
}
@@ -281,6 +281,14 @@ async function filterTabs(noteId) {
await saveOpenTabs();
}
async function noteDeleted(noteId) {
for (const tc of tabContexts) {
if (tc.notePath && tc.notePath.split("/").includes(noteId)) {
await tabRow.removeTab(tc.$tab[0]);
}
}
}
function focusOnTitle() {
getActiveTabContext().$noteTitle.focus();
}
@@ -496,5 +504,6 @@ export default {
activateTabContext,
clearOpenTabsTask,
filterTabs,
openEmptyTab
openEmptyTab,
noteDeleted
};