drag & drop notes from the tree into relation map

This commit is contained in:
azivner
2018-11-12 13:05:09 +01:00
parent bbe36fc7fb
commit 340916d5da
2 changed files with 21 additions and 2 deletions

View File

@@ -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) {