style/attachments page: add an icon to the upload button

This commit is contained in:
Adorian Doran 2025-03-12 02:49:40 +02:00
parent f86170f553
commit dd62979d65

View File

@ -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();