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 = {
|
const dragAndDropSetup = {
|
||||||
autoExpandMS: 600,
|
autoExpandMS: 600,
|
||||||
dragStart: (node, data) => {
|
dragStart: (node, data) => {
|
||||||
|
// don't allow dragging root node
|
||||||
if (node.data.noteId === 'root') {
|
if (node.data.noteId === 'root') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -22,11 +23,7 @@ const dragAndDropSetup = {
|
|||||||
// Return false to cancel dragging of node.
|
// Return false to cancel dragging of node.
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
dragEnter: (node, data) => {
|
dragEnter: (node, data) => true, // allow drop on any node
|
||||||
// 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
|
|
||||||
dragDrop: (node, data) => {
|
dragDrop: (node, data) => {
|
||||||
// This function MUST be defined to enable dropping of items on the tree.
|
// This function MUST be defined to enable dropping of items on the tree.
|
||||||
// data.hitMode is 'before', 'after', or 'over'.
|
// data.hitMode is 'before', 'after', or 'over'.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user