mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 10:55:55 +01:00
drag & drop notes from the tree into relation map
This commit is contained in:
@@ -456,10 +456,19 @@ function dragover_handler(ev) {
|
||||
|
||||
console.log("DRAGOVER");
|
||||
}
|
||||
|
||||
function drop_handler(ev) {
|
||||
ev.preventDefault();
|
||||
|
||||
console.log("DROP!", ev);
|
||||
const note = JSON.parse(ev.originalEvent.dataTransfer.getData("text"));
|
||||
|
||||
let {x, y} = getMousePosition(ev);
|
||||
|
||||
// modifying position so that cursor is on the top-center of the box
|
||||
x -= 80;
|
||||
y -= 15;
|
||||
|
||||
createNoteBox(note.noteId, note.title, x, y);
|
||||
}
|
||||
|
||||
function getMousePosition(evt) {
|
||||
|
||||
Reference in New Issue
Block a user