mirror of
https://github.com/zyllian/webdog.git
synced 2025-05-10 02:26:42 -07:00
hide copy button in code blocks if javascript is disabled
This commit is contained in:
parent
3f09554af4
commit
08c786faf2
3 changed files with 3 additions and 0 deletions
|
@ -171,6 +171,7 @@ abbr {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.copy {
|
.copy {
|
||||||
|
display: none;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.copy {
|
.copy {
|
||||||
|
display: none;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
|
@ -6,5 +6,6 @@
|
||||||
copyButton.addEventListener("click", async () => {
|
copyButton.addEventListener("click", async () => {
|
||||||
await navigator.clipboard.writeText(source);
|
await navigator.clipboard.writeText(source);
|
||||||
});
|
});
|
||||||
|
copyButton.style.display = "inline-block";
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue