From 08c786faf20c050383b46d3de50af34aac4f6835 Mon Sep 17 00:00:00 2001 From: zyl Date: Fri, 8 Nov 2024 22:42:37 -0800 Subject: [PATCH] hide copy button in code blocks if javascript is disabled --- site/sass/index.scss | 1 + src/embedded/default_site/sass/index.scss | 1 + src/embedded/js/webdog.js | 1 + 3 files changed, 3 insertions(+) diff --git a/site/sass/index.scss b/site/sass/index.scss index 739f91f..ae2a677 100644 --- a/site/sass/index.scss +++ b/site/sass/index.scss @@ -171,6 +171,7 @@ abbr { position: relative; .copy { + display: none; opacity: 0; z-index: 1; position: absolute; diff --git a/src/embedded/default_site/sass/index.scss b/src/embedded/default_site/sass/index.scss index 69e1289..239ad7e 100644 --- a/src/embedded/default_site/sass/index.scss +++ b/src/embedded/default_site/sass/index.scss @@ -7,6 +7,7 @@ position: relative; .copy { + display: none; opacity: 0; z-index: 1; position: absolute; diff --git a/src/embedded/js/webdog.js b/src/embedded/js/webdog.js index b6ab271..a05eddd 100644 --- a/src/embedded/js/webdog.js +++ b/src/embedded/js/webdog.js @@ -6,5 +6,6 @@ copyButton.addEventListener("click", async () => { await navigator.clipboard.writeText(source); }); + copyButton.style.display = "inline-block"; } })();