mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	the node you start dragging should be included even if not selected
This commit is contained in:
		| @@ -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) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user