mirror of
https://github.com/zadam/trilium.git
synced 2025-11-09 14:55:50 +01:00
fix tab title of deleted note
This commit is contained in:
@@ -602,18 +602,22 @@ export default class TabRowWidget extends BasicWidget {
|
||||
}
|
||||
|
||||
updateTab($tab, note) {
|
||||
if (!note || !$tab.length) {
|
||||
if (!$tab.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.updateTitle($tab, note.title);
|
||||
|
||||
for (const clazz of Array.from($tab[0].classList)) { // create copy to safely iterate over while removing classes
|
||||
if (clazz !== 'note-tab') {
|
||||
$tab.removeClass(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
if (!note) {
|
||||
this.updateTitle($tab, 'New tab');
|
||||
}
|
||||
|
||||
this.updateTitle($tab, note.title);
|
||||
|
||||
$tab.addClass(note.getCssClass());
|
||||
$tab.addClass(utils.getNoteTypeClass(note.type));
|
||||
$tab.addClass(utils.getMimeTypeClass(note.mime));
|
||||
@@ -636,4 +640,4 @@ export default class TabRowWidget extends BasicWidget {
|
||||
this.updateTab($tab, tabContext.note);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user