mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 13:01:31 +08:00 
			
		
		
		
	fix keyboard shortcut for "open externally"
This commit is contained in:
		
							parent
							
								
									ccac46527c
								
							
						
					
					
						commit
						b9133cb683
					
				| @ -1,6 +1,6 @@ | ||||
| import treeCache from "./tree_cache.js"; | ||||
| import bundleService from "./bundle.js"; | ||||
| import DialogCommandExecutor from "./dialog_command_executor.js"; | ||||
| import RootCommandExecutor from "./root_command_executor.js"; | ||||
| import Entrypoints from "./entrypoints.js"; | ||||
| import options from "./options.js"; | ||||
| import utils from "./utils.js"; | ||||
| @ -57,7 +57,7 @@ class AppContext extends Component { | ||||
| 
 | ||||
|         this.executors = [ | ||||
|             this.tabManager, | ||||
|             new DialogCommandExecutor(), | ||||
|             new RootCommandExecutor(), | ||||
|             new Entrypoints(), | ||||
|             new MainTreeExecutors() | ||||
|         ]; | ||||
|  | ||||
| @ -2,8 +2,9 @@ import Component from "../widgets/component.js"; | ||||
| import appContext from "./app_context.js"; | ||||
| import dateNoteService from "../services/date_notes.js"; | ||||
| import treeService from "../services/tree.js"; | ||||
| import openService from "./open.js"; | ||||
| 
 | ||||
| export default class DialogCommandExecutor extends Component { | ||||
| export default class RootCommandExecutor extends Component { | ||||
|     jumpToNoteCommand() { | ||||
|         import("../dialogs/jump_to_note.js").then(d => d.showDialog()); | ||||
|     } | ||||
| @ -84,4 +85,12 @@ export default class DialogCommandExecutor extends Component { | ||||
|     showBackendLogCommand() { | ||||
|         import("../dialogs/backend_log.js").then(d => d.showDialog()); | ||||
|     } | ||||
| 
 | ||||
|     openNoteExternallyCommand() { | ||||
|         const noteId = appContext.tabManager.getActiveTabNoteId(); | ||||
| 
 | ||||
|         if (noteId) { | ||||
|             openService.openNoteExternally(noteId); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -22,6 +22,7 @@ const TPL = ` | ||||
|         padding-left: 10px; | ||||
|         padding-right: 10px; | ||||
|         position: relative; | ||||
|         top: -2px; | ||||
|         border-radius: 0; | ||||
|     } | ||||
|      | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| import TabAwareWidget from "./tab_aware_widget.js"; | ||||
| import protectedSessionService from "../services/protected_session.js"; | ||||
| import openService from "../services/open.js"; | ||||
| import utils from "../services/utils.js"; | ||||
| 
 | ||||
| const TPL = ` | ||||
| <div class="dropdown note-actions"> | ||||
| @ -123,7 +123,6 @@ export default class NoteActionsWidget extends TabAwareWidget { | ||||
|             () => this.$widget.find('.dropdown-toggle').dropdown('toggle')); | ||||
| 
 | ||||
|         this.$openNoteExternallyButton = this.$widget.find(".open-note-externally-button"); | ||||
|         this.$openNoteExternallyButton.on('click', () => openService.openNoteExternally(this.noteId)); | ||||
|     } | ||||
| 
 | ||||
|     refreshWithNote(note) { | ||||
| @ -133,6 +132,8 @@ export default class NoteActionsWidget extends TabAwareWidget { | ||||
| 
 | ||||
|         this.$protectButton.toggle(!note.isProtected); | ||||
|         this.$unprotectButton.toggle(!!note.isProtected); | ||||
| 
 | ||||
|         this.$openNoteExternallyButton.toggle(utils.isElectron()); | ||||
|     } | ||||
| 
 | ||||
|     toggleDisabled($el, enable) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam