add hotkey to copy contents with line breaks, fixes #349 (#831)

This commit is contained in:
Heniker
2020-01-19 11:16:36 +03:00
committed by zadam
parent 1690248e24
commit 1876664dfb
3 changed files with 17 additions and 2 deletions

View File

@@ -241,6 +241,13 @@ function getUrlForDownload(url) {
}
}
function copySelectionToClipboard() {
const text = window.getSelection().toString()
if (navigator.clipboard) {
navigator.clipboard.writeText(text)
}
}
export default {
reloadApp,
parseDate,
@@ -273,5 +280,6 @@ export default {
isHtmlEmpty,
clearBrowserCache,
getUrlForDownload,
normalizeShortcut
normalizeShortcut,
copySelectionToClipboard
};