mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	Add Ctrl+Shift+L to pre-select "add to note"
This commit is contained in:
		| @@ -24,7 +24,11 @@ function setLinkType(linkType) { | |||||||
|     linkTypeChanged(); |     linkTypeChanged(); | ||||||
| } | } | ||||||
|  |  | ||||||
| async function showDialog() { | async function showDialogForClone() { | ||||||
|  |     showDialog('selected-to-current'); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | async function showDialog(linkType) { | ||||||
|     glob.activeDialog = $dialog; |     glob.activeDialog = $dialog; | ||||||
|  |  | ||||||
|     if (noteDetailService.getActiveNoteType() === 'text') { |     if (noteDetailService.getActiveNoteType() === 'text') { | ||||||
| @@ -38,6 +42,10 @@ async function showDialog() { | |||||||
|         setLinkType('selected-to-current'); |         setLinkType('selected-to-current'); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     if (linkType==='selected-to-current') { | ||||||
|  |         setLinkType(linkType); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     $dialog.modal(); |     $dialog.modal(); | ||||||
|  |  | ||||||
|     $autoComplete.val('').focus(); |     $autoComplete.val('').focus(); | ||||||
| @@ -142,5 +150,6 @@ $linkTypes.change(linkTypeChanged); | |||||||
| $dialog.on("hidden.bs.modal", () => noteDetailText.focus()); | $dialog.on("hidden.bs.modal", () => noteDetailText.focus()); | ||||||
|  |  | ||||||
| export default { | export default { | ||||||
|     showDialog |     showDialog, | ||||||
|  |     showDialogForClone | ||||||
| }; | }; | ||||||
| @@ -23,6 +23,7 @@ function registerEntrypoints() { | |||||||
|     jQuery.hotkeys.options.filterTextInputs = false; |     jQuery.hotkeys.options.filterTextInputs = false; | ||||||
|  |  | ||||||
|     utils.bindShortcut('ctrl+l', addLinkDialog.showDialog); |     utils.bindShortcut('ctrl+l', addLinkDialog.showDialog); | ||||||
|  |     utils.bindShortcut('ctrl+shift+l', addLinkDialog.showDialogForClone); | ||||||
|  |  | ||||||
|     $("#jump-to-note-dialog-button").click(jumpToNoteDialog.showDialog); |     $("#jump-to-note-dialog-button").click(jumpToNoteDialog.showDialog); | ||||||
|     utils.bindShortcut('ctrl+j', jumpToNoteDialog.showDialog); |     utils.bindShortcut('ctrl+j', jumpToNoteDialog.showDialog); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user