mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +08:00
style/attachments page: add an icon to the upload button
This commit is contained in:
parent
f86170f553
commit
dd62979d65
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user