From 8931f1778e0ea1caae621e8a8529cdd89fe7bfba Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 1 Dec 2024 11:35:58 +0200 Subject: [PATCH] feat(tabs): experiment with note icons instead of workspace icons --- src/public/app/widgets/tab_row.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/public/app/widgets/tab_row.js b/src/public/app/widgets/tab_row.js index 6ac6e177f..e1d439d75 100644 --- a/src/public/app/widgets/tab_row.js +++ b/src/public/app/widgets/tab_row.js @@ -670,12 +670,7 @@ export default class TabRowWidget extends BasicWidget { if (noteContext) { const hoistedNote = froca.getNoteFromCache(noteContext.hoistedNoteId); - if (hoistedNote) { - $tab.find('.note-tab-icon') - .removeClass() - .addClass("note-tab-icon") - .addClass(hoistedNote.getWorkspaceIconClass()); - + if (hoistedNote) { $tab.find('.note-tab-wrapper').css("background", hoistedNote.getWorkspaceTabBackgroundColor()); } else { @@ -688,7 +683,7 @@ export default class TabRowWidget extends BasicWidget { if (!note) { this.updateTitle($tab, t('tab_row.new_tab')); return; - } + } const title = await noteContext.getNavigationTitle(); this.updateTitle($tab, title); @@ -696,6 +691,11 @@ export default class TabRowWidget extends BasicWidget { $tab.addClass(note.getCssClass()); $tab.addClass(utils.getNoteTypeClass(note.type)); $tab.addClass(utils.getMimeTypeClass(note.mime)); + + $tab.find('.note-tab-icon') + .removeClass() + .addClass("note-tab-icon") + .addClass(note.getIcon()); } async entitiesReloadedEvent({loadResults}) {