fixes of the new CopyWithoutFormatting

This commit is contained in:
zadam 2020-01-19 09:25:35 +01:00
parent 1876664dfb
commit ab535bf147
3 changed files with 5 additions and 6 deletions

View file

@ -289,8 +289,7 @@ function registerEntrypoints() {
searchNotesService.searchInSubtree(node.data.noteId); searchNotesService.searchInSubtree(node.data.noteId);
}); });
$('document').on('copy', utils.copySelectionToClipboard) keyboardActionService.setGlobalActionHandler("CopyWithoutFormatting", utils.copySelectionToClipboard);
keyboardActionService.setGlobalActionHandler("CopyWithoutFormating", utils.copySelectionToClipboard)
} }
export default { export default {

View file

@ -242,9 +242,9 @@ function getUrlForDownload(url) {
} }
function copySelectionToClipboard() { function copySelectionToClipboard() {
const text = window.getSelection().toString() const text = window.getSelection().toString();
if (navigator.clipboard) { if (navigator.clipboard) {
navigator.clipboard.writeText(text) navigator.clipboard.writeText(text);
} }
} }

View file

@ -308,8 +308,8 @@ const DEFAULT_KEYBOARD_ACTIONS = [
defaultShortcuts: ["CommandOrControl+="] defaultShortcuts: ["CommandOrControl+="]
}, },
{ {
actionName: "CopyWithoutFormating", actionName: "CopyWithoutFormatting",
defaultShortcuts: ["Alt+Ctrl+C"] defaultShortcuts: ["CommandOrControl+Alt+C"]
} }
]; ];