From ab535bf147edac113299f76f410ff88b2c06735b Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 19 Jan 2020 09:25:35 +0100 Subject: [PATCH] fixes of the new CopyWithoutFormatting --- src/public/javascripts/services/entrypoints.js | 3 +-- src/public/javascripts/services/utils.js | 4 ++-- src/services/keyboard_actions.js | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/public/javascripts/services/entrypoints.js b/src/public/javascripts/services/entrypoints.js index 968d2f3ad..a1b2abbad 100644 --- a/src/public/javascripts/services/entrypoints.js +++ b/src/public/javascripts/services/entrypoints.js @@ -289,8 +289,7 @@ function registerEntrypoints() { searchNotesService.searchInSubtree(node.data.noteId); }); - $('document').on('copy', utils.copySelectionToClipboard) - keyboardActionService.setGlobalActionHandler("CopyWithoutFormating", utils.copySelectionToClipboard) + keyboardActionService.setGlobalActionHandler("CopyWithoutFormatting", utils.copySelectionToClipboard); } export default { diff --git a/src/public/javascripts/services/utils.js b/src/public/javascripts/services/utils.js index a666b5fcd..2c6c0e9f1 100644 --- a/src/public/javascripts/services/utils.js +++ b/src/public/javascripts/services/utils.js @@ -242,9 +242,9 @@ function getUrlForDownload(url) { } function copySelectionToClipboard() { - const text = window.getSelection().toString() + const text = window.getSelection().toString(); if (navigator.clipboard) { - navigator.clipboard.writeText(text) + navigator.clipboard.writeText(text); } } diff --git a/src/services/keyboard_actions.js b/src/services/keyboard_actions.js index 6a4a65f3d..c8b1b7dd5 100644 --- a/src/services/keyboard_actions.js +++ b/src/services/keyboard_actions.js @@ -308,8 +308,8 @@ const DEFAULT_KEYBOARD_ACTIONS = [ defaultShortcuts: ["CommandOrControl+="] }, { - actionName: "CopyWithoutFormating", - defaultShortcuts: ["Alt+Ctrl+C"] + actionName: "CopyWithoutFormatting", + defaultShortcuts: ["CommandOrControl+Alt+C"] } ];