From dd62979d6503e4b0bcae493fff6ab483cfa08595 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Wed, 12 Mar 2025 02:49:40 +0200 Subject: [PATCH] style/attachments page: add an icon to the upload button --- .../widgets/type_widgets/attachment_list.ts | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/public/app/widgets/type_widgets/attachment_list.ts b/src/public/app/widgets/type_widgets/attachment_list.ts index f39f7782c..937efb9d8 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 = $(` + + `); + + $uploadButton.on("click", () => { + if (this.noteId) { + this.triggerCommand("showUploadAttachmentsDialog", { noteId: this.noteId }); + } + }) + this.$linksWrapper.empty().append( $("
").append(t("attachment_list.owning_note"), noteLink), - $(`
`).append( - $('