[Users | Trunk]: Add copy event listener to trim selection text
This commit is contained in:
parent
90e7a3095e
commit
230284002e
|
@ -69,8 +69,4 @@ a:hover, .uk-link:hover {
|
|||
display: -ms-flexbox; /* TWEENER - IE 10 */
|
||||
display: -webkit-flex; /* NEW - Chrome */
|
||||
display: flex; /* NEW, Spec - Opera 12.1, Firefox 20+ */
|
||||
}
|
||||
|
||||
code {
|
||||
user-select: all;
|
||||
}
|
|
@ -30,6 +30,13 @@
|
|||
console.error('unable to copy text');
|
||||
}
|
||||
}
|
||||
$(document).ready(function () {
|
||||
document.addEventListener('copy', (event) => {
|
||||
const selection = document.getSelection();
|
||||
event.clipboardData.setData('text/plain', selection.toString().trim());
|
||||
event.preventDefault();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<link rel="stylesheet" style="text/css" href="./css/theme.css">
|
||||
<link rel="stylesheet" style="text/css" href="./css/custom.css">
|
||||
|
|
Loading…
Reference in New Issue