mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix broken drag & drop, closes 252
This commit is contained in:
parent
90a52f57b5
commit
492adc2909
@ -4,6 +4,7 @@ import treeChangesService from './branches.js';
|
||||
const dragAndDropSetup = {
|
||||
autoExpandMS: 600,
|
||||
dragStart: (node, data) => {
|
||||
// don't allow dragging root node
|
||||
if (node.data.noteId === 'root') {
|
||||
return false;
|
||||
}
|
||||
@ -22,11 +23,7 @@ const dragAndDropSetup = {
|
||||
// Return false to cancel dragging of node.
|
||||
return true;
|
||||
},
|
||||
dragEnter: (node, data) => {
|
||||
// we don't allow moving root to any other location in the tree
|
||||
// we allow it to be placed on the relation map though, that's handled in a different drop handler
|
||||
return node.data.noteId === 'root';
|
||||
}, // allow drop on any node
|
||||
dragEnter: (node, data) => true, // allow drop on any node
|
||||
dragDrop: (node, data) => {
|
||||
// This function MUST be defined to enable dropping of items on the tree.
|
||||
// data.hitMode is 'before', 'after', or 'over'.
|
||||
|
Loading…
x
Reference in New Issue
Block a user