aboutsummaryrefslogtreecommitdiff
path: root/assets/clipboard.js
diff options
context:
space:
mode:
authorAlexander Danilov <a.a.danilov@gmail.com>2022-07-04 09:55:54 +0300
committerGitHub <noreply@github.com>2022-07-04 08:55:54 +0200
commitc02453860408509b714c5e853457b66ef07712fc (patch)
tree7cd4a09b0eee991de966f7c8a5c3b22337e205b9 /assets/clipboard.js
parent4ef38f3bbf5dae9a11a711d2ed1ced9294c6af5f (diff)
Ignore code block clicks with active selection (#448)
Diffstat (limited to 'assets/clipboard.js')
-rw-r--r--assets/clipboard.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/assets/clipboard.js b/assets/clipboard.js
index fdf84cf..2799f2f 100644
--- a/assets/clipboard.js
+++ b/assets/clipboard.js
@@ -11,6 +11,9 @@
document.querySelectorAll("pre code").forEach(code => {
code.addEventListener("click", function (event) {
+ if (window.getSelection().toString()) {
+ return;
+ }
select(code.parentElement);
if (navigator.clipboard) {