mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-30 20:41:33 +08:00 
			
		
		
		
	added context menu "recent changes in subtree"
This commit is contained in:
		
							parent
							
								
									cc298b1e7a
								
							
						
					
					
						commit
						189202b1f6
					
				| @ -9,10 +9,14 @@ import hoistedNoteService from "../services/hoisted_note.js"; | ||||
| const $dialog = $("#recent-changes-dialog"); | ||||
| const $content = $("#recent-changes-content"); | ||||
| 
 | ||||
| export async function showDialog() { | ||||
| export async function showDialog(ancestorNoteId) { | ||||
|     utils.openDialog($dialog); | ||||
| 
 | ||||
|     const result = await server.get('recent-changes/' + hoistedNoteService.getHoistedNoteId()); | ||||
|     if (!ancestorNoteId) { | ||||
|         ancestorNoteId = hoistedNoteService.getHoistedNoteId(); | ||||
|     } | ||||
| 
 | ||||
|     const result = await server.get('recent-changes/' + ancestorNoteId); | ||||
| 
 | ||||
|     // preload all notes into cache
 | ||||
|     await treeCache.getNotes(result.map(r => r.noteId), true); | ||||
|  | ||||
| @ -75,7 +75,8 @@ class TreeContextMenu { | ||||
|             { title: "Advanced", uiIcon: "empty", enabled: true, items: [ | ||||
|                     { title: 'Collapse subtree <kbd data-command="collapseSubtree"></kbd>', command: "collapseSubtree", uiIcon: "align-justify", enabled: noSelectedNotes }, | ||||
|                     { title: "Force note sync", command: "forceNoteSync", uiIcon: "refresh", enabled: noSelectedNotes }, | ||||
|                     { title: 'Sort alphabetically <kbd data-command="sortChildNotes"></kbd>', command: "sortChildNotes", uiIcon: "empty", enabled: noSelectedNotes && notSearch } | ||||
|                     { title: 'Sort alphabetically <kbd data-command="sortChildNotes"></kbd>', command: "sortChildNotes", uiIcon: "empty", enabled: noSelectedNotes && notSearch }, | ||||
|                     { title: 'Recent changes in subtree', command: "recentChangesInSubtree", uiIcon: "history", enabled: noSelectedNotes } | ||||
|                 ] }, | ||||
|             { title: "----" }, | ||||
|             { title: "Protect subtree", command: "protectSubtree", uiIcon: "check-shield", enabled: noSelectedNotes }, | ||||
|  | ||||
| @ -737,6 +737,12 @@ export default class NoteTreeWidget extends TabAwareWidget { | ||||
|         treeService.sortAlphabetically(node.data.noteId); | ||||
|     } | ||||
| 
 | ||||
|     async recentChangesInSubtreeCommand({node}) { | ||||
|         const recentChangesDialog = await import('../dialogs/recent_changes.js'); | ||||
| 
 | ||||
|         recentChangesDialog.showDialog(node.data.noteId); | ||||
|     } | ||||
| 
 | ||||
|     selectAllNotesInParentCommand({node}) { | ||||
|         for (const child of node.getParent().getChildren()) { | ||||
|             child.setSelected(true); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam