Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
style/attachments page: add an icon to the upload button
Adorian Dorandd62979d6503
diff --git a/src/public/app/widgets/type_widgets/attachment_list.ts b/src/public/app/widgets/type_widgets/attachment_list.tsindex f39f7782c6..937efb9d82 100644--- a/src/public/app/widgets/type_widgets/attachment_list.ts+++ b/src/public/app/widgets/type_widgets/attachment_list.ts@@ -59,18 +59,22 @@ export default class AttachmentListTypeWidget extends TypeWidget {const noteLink = await linkService.createLink(this.noteId); // do separately to avoid race condition between empty() and .append()noteLink.addClass("use-tn-links");+ const $uploadButton = $(`+ <button class="btn btn-sm">+ <span class="bx bx-folder-open"></span>+ ${t("attachment_list.upload_attachments")}+ </button>+ `);++ $uploadButton.on("click", () => {+ if (this.noteId) {+ this.triggerCommand("showUploadAttachmentsDialog", { noteId: this.noteId });+ }+ })+this.$linksWrapper.empty().append($("<div>").append(t("attachment_list.owning_note"), noteLink),- $(`<div class="attachment-actions-toolbar">`).append(- $('<button class="btn btn-sm">')- .text(t("attachment_list.upload_attachments"))- .on("click", () => {- if (this.noteId) {- this.triggerCommand("showUploadAttachmentsDialog", { noteId: this.noteId });- }- }),- $helpButton- )+ $(`<div class="attachment-actions-toolbar">`).append($uploadButton, $helpButton));this.$list.empty();