mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-30 12:13:52 +08:00 
			
		
		
		
	fix clone-to, move-to keyboard shortcuts
This commit is contained in:
		
							parent
							
								
									7f2c859b94
								
							
						
					
					
						commit
						3a4d32f163
					
				| @ -167,4 +167,16 @@ export default class Entrypoints extends Component { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     createTopLevelNoteCommand() { noteCreateService.createNewTopLevelNote(); } |     createTopLevelNoteCommand() { noteCreateService.createNewTopLevelNote(); } | ||||||
|  | 
 | ||||||
|  |     async cloneNotesToCommand() { | ||||||
|  |         const selectedOrActiveNoteIds = appContext.mainTreeWidget.getSelectedOrActiveNodes().map(node => node.data.noteId); | ||||||
|  | 
 | ||||||
|  |         this.triggerCommand('cloneNoteIdsTo', {noteIds: selectedOrActiveNoteIds}); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     async moveNotesToCommand() { | ||||||
|  |         const selectedOrActiveBranchIds = appContext.mainTreeWidget.getSelectedOrActiveNodes().map(node => node.data.branchId); | ||||||
|  | 
 | ||||||
|  |         this.triggerCommand('moveBranchIdsTo', {branchIds: selectedOrActiveBranchIds}); | ||||||
|  |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -25,6 +25,7 @@ import NoteRevisionsWidget from "./note_revisions.js"; | |||||||
| import SimilarNotesWidget from "./similar_notes.js"; | import SimilarNotesWidget from "./similar_notes.js"; | ||||||
| import WhatLinksHereWidget from "./what_links_here.js"; | import WhatLinksHereWidget from "./what_links_here.js"; | ||||||
| import SidePaneToggles from "./side_pane_toggles.js"; | import SidePaneToggles from "./side_pane_toggles.js"; | ||||||
|  | import appContext from "../services/app_context.js"; | ||||||
| 
 | 
 | ||||||
| const RIGHT_PANE_CSS = ` | const RIGHT_PANE_CSS = ` | ||||||
| <style> | <style> | ||||||
| @ -99,6 +100,8 @@ const RIGHT_PANE_CSS = ` | |||||||
| 
 | 
 | ||||||
| export default class DesktopLayout { | export default class DesktopLayout { | ||||||
|     getRootWidget(appContext) { |     getRootWidget(appContext) { | ||||||
|  |         appContext.mainTreeWidget = new NoteTreeWidget(); | ||||||
|  | 
 | ||||||
|         return new FlexContainer('column') |         return new FlexContainer('column') | ||||||
|             .setParent(appContext) |             .setParent(appContext) | ||||||
|             .id('root-widget') |             .id('root-widget') | ||||||
| @ -116,7 +119,7 @@ export default class DesktopLayout { | |||||||
|                     .child(new GlobalButtonsWidget()) |                     .child(new GlobalButtonsWidget()) | ||||||
|                     .child(new SearchBoxWidget()) |                     .child(new SearchBoxWidget()) | ||||||
|                     .child(new SearchResultsWidget()) |                     .child(new SearchResultsWidget()) | ||||||
|                     .child(new NoteTreeWidget()) |                     .child(appContext.mainTreeWidget) | ||||||
|                 ) |                 ) | ||||||
|                 .child(new FlexContainer('column').id('center-pane') |                 .child(new FlexContainer('column').id('center-pane') | ||||||
|                     .child(new FlexContainer('row').class('title-row') |                     .child(new FlexContainer('row').class('title-row') | ||||||
|  | |||||||
| @ -618,18 +618,6 @@ export default class NoteTreeWidget extends TabAwareWidget { | |||||||
|         this.reloadTreeFromCache(); |         this.reloadTreeFromCache(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     async cloneNotesToCommand() { |  | ||||||
|         const selectedOrActiveNoteIds = this.getSelectedOrActiveNodes().map(node => node.data.noteId); |  | ||||||
| 
 |  | ||||||
|         this.triggerCommand('cloneNoteIdsTo', {noteIds: selectedOrActiveNoteIds}); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     async moveNotesToCommand() { |  | ||||||
|         const selectedOrActiveBranchIds = this.getSelectedOrActiveNodes().map(node => node.data.branchId); |  | ||||||
| 
 |  | ||||||
|         this.triggerCommand('moveBranchIdsTo', {branchIds: selectedOrActiveBranchIds}); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     async getHotKeys() { |     async getHotKeys() { | ||||||
|         const actions = await keyboardActionsService.getActionsForScope('note-tree'); |         const actions = await keyboardActionsService.getActionsForScope('note-tree'); | ||||||
|         const hotKeyMap = { |         const hotKeyMap = { | ||||||
| @ -830,6 +818,6 @@ export default class NoteTreeWidget extends TabAwareWidget { | |||||||
|     duplicateNoteCommand({node}) { |     duplicateNoteCommand({node}) { | ||||||
|         const branch = treeCache.getBranch(node.data.branchId); |         const branch = treeCache.getBranch(node.data.branchId); | ||||||
| 
 | 
 | ||||||
|         noteCreateService.duplicateNote(noteId, branch.parentNoteId); |         noteCreateService.duplicateNote(node.data.noteId, branch.parentNoteId); | ||||||
|     } |     } | ||||||
| } | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam