mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-30 18:05:55 +01:00 
			
		
		
		
	CTRL-C CTRL-V now clones the note
This commit is contained in:
		| @@ -15,8 +15,11 @@ const contextMenu = (function() { | |||||||
|         else if (clipboardMode === 'copy') { |         else if (clipboardMode === 'copy') { | ||||||
|             treeChanges.cloneNoteAfter(clipboardId, node.data.note_tree_id); |             treeChanges.cloneNoteAfter(clipboardId, node.data.note_tree_id); | ||||||
|         } |         } | ||||||
|  |         else if (clipboardId === null) { | ||||||
|  |             // just do nothing | ||||||
|  |         } | ||||||
|         else { |         else { | ||||||
|             throw new Error("Unrecognized clipboard mode=" + mode); |             throw new Error("Unrecognized clipboard mode=" + clipboardMode); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         clipboardId = null; |         clipboardId = null; | ||||||
| @@ -127,6 +130,7 @@ const contextMenu = (function() { | |||||||
|         pasteAfter, |         pasteAfter, | ||||||
|         pasteInto, |         pasteInto, | ||||||
|         cut, |         cut, | ||||||
|  |         copy, | ||||||
|         contextMenuSettings |         contextMenuSettings | ||||||
|     } |     } | ||||||
| })(); | })(); | ||||||
| @@ -171,9 +171,7 @@ const noteEditor = (function() { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     $(document).ready(() => { |     $(document).ready(() => { | ||||||
|         noteTitleEl.on('input', () => { |         noteTitleEl.on('input', noteChanged); | ||||||
|             noteChanged(); |  | ||||||
|         }); |  | ||||||
|  |  | ||||||
|         noteDetailEl.summernote({ |         noteDetailEl.summernote({ | ||||||
|             airMode: true, |             airMode: true, | ||||||
|   | |||||||
| @@ -435,23 +435,19 @@ const noteTree = (function() { | |||||||
|                         return false; |                         return false; | ||||||
|  |  | ||||||
|                     // Handle Ctrl-C, -X and -V |                     // Handle Ctrl-C, -X and -V | ||||||
|                     // case 67: |                     case 67: | ||||||
|                     //     if (event.ctrlKey) { // Ctrl-C |                         if (event.ctrlKey) { // Ctrl-C | ||||||
|                     //         copyPaste("copy", node); |                             contextMenu.copy(node); | ||||||
|                     //         return false; |                             return false; | ||||||
|                     //     } |                         } | ||||||
|                     //     break; |                         break; | ||||||
|                     case 86: |                     case 86: | ||||||
|                         console.log("CTRL-V"); |  | ||||||
|  |  | ||||||
|                         if (event.ctrlKey) { // Ctrl-V |                         if (event.ctrlKey) { // Ctrl-V | ||||||
|                             contextMenu.pasteAfter(node); |                             contextMenu.pasteAfter(node); | ||||||
|                             return false; |                             return false; | ||||||
|                         } |                         } | ||||||
|                         break; |                         break; | ||||||
|                     case 88: |                     case 88: | ||||||
|                         console.log("CTRL-X"); |  | ||||||
|  |  | ||||||
|                         if (event.ctrlKey) { // Ctrl-X |                         if (event.ctrlKey) { // Ctrl-X | ||||||
|                             contextMenu.cut(node); |                             contextMenu.cut(node); | ||||||
|                             return false; |                             return false; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user