attachments WIP

This commit is contained in:
zadam
2023-05-29 00:19:54 +02:00
parent c2f70031d0
commit 0aa119af2c
37 changed files with 448 additions and 320 deletions

View File

@@ -396,11 +396,11 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
}));
if (notes.length === 1) {
linkService.createNoteLink(notes[0].noteId, {referenceLink: true})
linkService.createLink(notes[0].noteId, {referenceLink: true})
.then($link => data.dataTransfer.setData("text/html", $link[0].outerHTML));
}
else {
Promise.all(notes.map(note => linkService.createNoteLink(note.noteId, {referenceLink: true}))).then(links => {
Promise.all(notes.map(note => linkService.createLink(note.noteId, {referenceLink: true}))).then(links => {
const $list = $("<ul>").append(...links.map($link => $("<li>").append($link)));
data.dataTransfer.setData("text/html", $list[0].outerHTML);