mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
the node you start dragging should be included even if not selected
This commit is contained in:
parent
e25b633ec4
commit
50a28d8c51
@ -583,13 +583,18 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
|||||||
|
|
||||||
/** @return {FancytreeNode[]} */
|
/** @return {FancytreeNode[]} */
|
||||||
getSelectedOrActiveNodes(node = null) {
|
getSelectedOrActiveNodes(node = null) {
|
||||||
const notes = this.getSelectedNodes(true);
|
const nodes = this.getSelectedNodes(true);
|
||||||
|
|
||||||
if (notes.length === 0) {
|
// the node you start dragging should be included even if not selected
|
||||||
notes.push(node ? node : this.getActiveNode());
|
if (node && !nodes.find(n => n.key === node.key)) {
|
||||||
|
nodes.push(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
return notes;
|
if (nodes.length === 0) {
|
||||||
|
nodes.push(this.getActiveNode());
|
||||||
|
}
|
||||||
|
|
||||||
|
return nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
async setExpandedStatusForSubtree(node, isExpanded) {
|
async setExpandedStatusForSubtree(node, isExpanded) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user