mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-26 15:01:32 +08:00
feat(tabs): experiment with note icons instead of workspace icons
This commit is contained in:
parent
0dbe88092e
commit
8931f1778e
@ -670,12 +670,7 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
if (noteContext) {
|
if (noteContext) {
|
||||||
const hoistedNote = froca.getNoteFromCache(noteContext.hoistedNoteId);
|
const hoistedNote = froca.getNoteFromCache(noteContext.hoistedNoteId);
|
||||||
|
|
||||||
if (hoistedNote) {
|
if (hoistedNote) {
|
||||||
$tab.find('.note-tab-icon')
|
|
||||||
.removeClass()
|
|
||||||
.addClass("note-tab-icon")
|
|
||||||
.addClass(hoistedNote.getWorkspaceIconClass());
|
|
||||||
|
|
||||||
$tab.find('.note-tab-wrapper').css("background", hoistedNote.getWorkspaceTabBackgroundColor());
|
$tab.find('.note-tab-wrapper').css("background", hoistedNote.getWorkspaceTabBackgroundColor());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -688,7 +683,7 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
if (!note) {
|
if (!note) {
|
||||||
this.updateTitle($tab, t('tab_row.new_tab'));
|
this.updateTitle($tab, t('tab_row.new_tab'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const title = await noteContext.getNavigationTitle();
|
const title = await noteContext.getNavigationTitle();
|
||||||
this.updateTitle($tab, title);
|
this.updateTitle($tab, title);
|
||||||
@ -696,6 +691,11 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
$tab.addClass(note.getCssClass());
|
$tab.addClass(note.getCssClass());
|
||||||
$tab.addClass(utils.getNoteTypeClass(note.type));
|
$tab.addClass(utils.getNoteTypeClass(note.type));
|
||||||
$tab.addClass(utils.getMimeTypeClass(note.mime));
|
$tab.addClass(utils.getMimeTypeClass(note.mime));
|
||||||
|
|
||||||
|
$tab.find('.note-tab-icon')
|
||||||
|
.removeClass()
|
||||||
|
.addClass("note-tab-icon")
|
||||||
|
.addClass(note.getIcon());
|
||||||
}
|
}
|
||||||
|
|
||||||
async entitiesReloadedEvent({loadResults}) {
|
async entitiesReloadedEvent({loadResults}) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user