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