mirror of
https://github.com/zadam/trilium.git
synced 2025-01-16 12:08:03 +08:00
fixes of the new CopyWithoutFormatting
This commit is contained in:
parent
1876664dfb
commit
ab535bf147
3 changed files with 5 additions and 6 deletions
|
@ -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 {
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -308,8 +308,8 @@ const DEFAULT_KEYBOARD_ACTIONS = [
|
||||||
defaultShortcuts: ["CommandOrControl+="]
|
defaultShortcuts: ["CommandOrControl+="]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
actionName: "CopyWithoutFormating",
|
actionName: "CopyWithoutFormatting",
|
||||||
defaultShortcuts: ["Alt+Ctrl+C"]
|
defaultShortcuts: ["CommandOrControl+Alt+C"]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue