mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	fix note hoisting
This commit is contained in:
		| @@ -1174,27 +1174,27 @@ export default class NoteTreeWidget extends NoteContextAwareWidget { | |||||||
|  |  | ||||||
|     async hoistedNoteChangedEvent({ntxId}) { |     async hoistedNoteChangedEvent({ntxId}) { | ||||||
|         if (this.isNoteContext(ntxId)) { |         if (this.isNoteContext(ntxId)) { | ||||||
|             this.filterHoistedBranch(); |             await this.filterHoistedBranch(); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     async filterHoistedBranch() { |     async filterHoistedBranch() { | ||||||
|         if (this.noteContext) { |         if (!this.noteContext) { | ||||||
|             // make sure the hoisted node is loaded (can be unloaded e.g. after tree collapse in another tab) |             return; | ||||||
|  |         } | ||||||
|  |  | ||||||
|         const hoistedNotePath = await treeService.resolveNotePath(this.noteContext.hoistedNoteId); |         const hoistedNotePath = await treeService.resolveNotePath(this.noteContext.hoistedNoteId); | ||||||
|         await this.getNodeFromPath(hoistedNotePath); |         await this.getNodeFromPath(hoistedNotePath); | ||||||
|  |  | ||||||
|         if (this.noteContext.hoistedNoteId === 'root') { |         if (this.noteContext.hoistedNoteId === 'root') { | ||||||
|             this.tree.clearFilter(); |             this.tree.clearFilter(); | ||||||
|             } |         } else { | ||||||
|             else { |  | ||||||
|             // hack when hoisted note is cloned then it could be filtered multiple times while we want only 1 |             // hack when hoisted note is cloned then it could be filtered multiple times while we want only 1 | ||||||
|             this.tree.filterBranches(node => |             this.tree.filterBranches(node => | ||||||
|                 node.data.noteId === this.noteContext.hoistedNoteId // optimization to not having always resolve the node path |                 node.data.noteId === this.noteContext.hoistedNoteId // optimization to not having always resolve the node path | ||||||
|                 && treeService.getNotePath(node) === hoistedNotePath); |                 && treeService.getNotePath(node) === hoistedNotePath); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     } |  | ||||||
|  |  | ||||||
|     frocaReloadedEvent() { |     frocaReloadedEvent() { | ||||||
|         this.reloadTreeFromCache(); |         this.reloadTreeFromCache(); | ||||||
|   | |||||||
| @@ -2,6 +2,14 @@ ul.fancytree-container { | |||||||
|     padding-left: 0; |     padding-left: 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | ul.fancytree-container li { | ||||||
|  |     list-style: none; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | span.fancytree-node.fancytree-hide { | ||||||
|  |     display: none; | ||||||
|  | } | ||||||
|  |  | ||||||
| .fancytree-title { | .fancytree-title { | ||||||
|     margin-left: 7px !important; |     margin-left: 7px !important; | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user