mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 03:29:02 +01:00 
			
		
		
		
	feat(touchbar): delete note in note tree
This commit is contained in:
		
							parent
							
								
									9d9ed2edcb
								
							
						
					
					
						commit
						f98ac84829
					
				| @ -25,6 +25,8 @@ import type FNote from "../entities/fnote.js"; | |||||||
| import type { NoteType } from "../entities/fnote.js"; | import type { NoteType } from "../entities/fnote.js"; | ||||||
| import type { AttributeRow, BranchRow } from "../services/load_results.js"; | import type { AttributeRow, BranchRow } from "../services/load_results.js"; | ||||||
| import type { SetNoteOpts } from "../components/note_context.js"; | import type { SetNoteOpts } from "../components/note_context.js"; | ||||||
|  | import type { TouchBarItem } from "./touch_bar.js"; | ||||||
|  | import type { TreeCommandNames } from "../menus/tree_context_menu.js"; | ||||||
| 
 | 
 | ||||||
| const TPL = /*html*/` | const TPL = /*html*/` | ||||||
| <div class="tree-wrapper"> | <div class="tree-wrapper"> | ||||||
| @ -1760,4 +1762,28 @@ export default class NoteTreeWidget extends NoteContextAwareWidget { | |||||||
| 
 | 
 | ||||||
|         appContext.tabManager.getActiveContext()?.setNote(resp.note.noteId); |         appContext.tabManager.getActiveContext()?.setNote(resp.note.noteId); | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     buildTouchBarCommand({ TouchBar, buildIcon }: CommandListenerData<"buildTouchBar">) { | ||||||
|  |         const triggerCommand = (command: TreeCommandNames) => { | ||||||
|  |             const node = this.getActiveNode(); | ||||||
|  |             const notePath = treeService.getNotePath(node); | ||||||
|  | 
 | ||||||
|  |             this.triggerCommand<TreeCommandNames>(command, { | ||||||
|  |                 node, | ||||||
|  |                 notePath, | ||||||
|  |                 noteId: node.data.noteId, | ||||||
|  |                 selectedOrActiveBranchIds: this.getSelectedOrActiveBranchIds(node), | ||||||
|  |                 selectedOrActiveNoteIds: this.getSelectedOrActiveNoteIds(node) | ||||||
|  |             }); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         const items: TouchBarItem[] = [ | ||||||
|  |             new TouchBar.TouchBarButton({ | ||||||
|  |                 icon: buildIcon("NSImageNameTouchBarDeleteTemplate"), | ||||||
|  |                 click: () => triggerCommand("deleteNotes") | ||||||
|  |             }) | ||||||
|  |         ]; | ||||||
|  | 
 | ||||||
|  |         return items; | ||||||
|  |     } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran