mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2024-11-21 19:09:29 +00:00
Ignore code block clicks with active selection (#448)
This commit is contained in:
parent
4ef38f3bbf
commit
c024538604
@ -11,6 +11,9 @@
|
|||||||
|
|
||||||
document.querySelectorAll("pre code").forEach(code => {
|
document.querySelectorAll("pre code").forEach(code => {
|
||||||
code.addEventListener("click", function (event) {
|
code.addEventListener("click", function (event) {
|
||||||
|
if (window.getSelection().toString()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
select(code.parentElement);
|
select(code.parentElement);
|
||||||
|
|
||||||
if (navigator.clipboard) {
|
if (navigator.clipboard) {
|
||||||
|
Loading…
Reference in New Issue
Block a user