mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	Merge remote-tracking branch 'origin/stable'
# Conflicts: # src/services/note_cache/entities/note.js
This commit is contained in:
		| @@ -1245,7 +1245,25 @@ export default class NoteTreeWidget extends TabAwareWidget { | ||||
|         this.clearSelectedNodes(); | ||||
|     } | ||||
|  | ||||
|     canBeMovedUpOrDown(node) { | ||||
|         if (node.data.noteId === 'root') { | ||||
|             return false; | ||||
|         } | ||||
|  | ||||
|         const parentNote = treeCache.getNoteFromCache(node.getParent().data.noteId); | ||||
|  | ||||
|         if (parentNote && parentNote.hasLabel('sorted')) { | ||||
|             return false; | ||||
|         } | ||||
|  | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     moveNoteUpCommand({node}) { | ||||
|         if (!this.canBeMovedUpOrDown(node)) { | ||||
|             return; | ||||
|         } | ||||
|  | ||||
|         const beforeNode = node.getPrevSibling(); | ||||
|  | ||||
|         if (beforeNode !== null) { | ||||
| @@ -1254,7 +1272,12 @@ export default class NoteTreeWidget extends TabAwareWidget { | ||||
|     } | ||||
|  | ||||
|     moveNoteDownCommand({node}) { | ||||
|         if (!this.canBeMovedUpOrDown(node)) { | ||||
|             return; | ||||
|         } | ||||
|  | ||||
|         const afterNode = node.getNextSibling(); | ||||
|  | ||||
|         if (afterNode !== null) { | ||||
|             branchService.moveAfterBranch([node.data.branchId], afterNode.data.branchId); | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user