mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 23:29:02 +02:00
client/note type chooser: add support for badges
This commit is contained in:
parent
5bf01106c5
commit
1af8edfe4d
@ -154,13 +154,21 @@ export default class NoteTypeChooserDialog extends BasicWidget {
|
|||||||
this.$noteTypeDropdown.append($('<h6 class="dropdown-header">').append(t("note_type_chooser.templates")));
|
this.$noteTypeDropdown.append($('<h6 class="dropdown-header">').append(t("note_type_chooser.templates")));
|
||||||
} else {
|
} else {
|
||||||
const commandItem = noteType as MenuCommandItem<CommandNames>;
|
const commandItem = noteType as MenuCommandItem<CommandNames>;
|
||||||
this.$noteTypeDropdown.append(
|
const listItem = $('<a class="dropdown-item" tabindex="0">')
|
||||||
$('<a class="dropdown-item" tabindex="0">')
|
.attr("data-note-type", commandItem.type || "")
|
||||||
.attr("data-note-type", commandItem.type || "")
|
.attr("data-template-note-id", commandItem.templateNoteId || "")
|
||||||
.attr("data-template-note-id", commandItem.templateNoteId || "")
|
.append($("<span>").addClass(commandItem.uiIcon || ""))
|
||||||
.append($("<span>").addClass(commandItem.uiIcon || ""))
|
.append(` ${noteType.title}`);
|
||||||
.append(` ${noteType.title}`)
|
|
||||||
);
|
if (commandItem.badges) {
|
||||||
|
for (let badge of commandItem.badges) {
|
||||||
|
listItem.append($(`<span class="badge">`)
|
||||||
|
.addClass(badge.className || "")
|
||||||
|
.text(badge.title));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$noteTypeDropdown.append(listItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user