hide copy buttons when js is not enabled

Fixes #5
This commit is contained in:
neri 2021-04-04 14:49:34 +02:00
parent e49800f05e
commit b8fac27511
4 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,5 @@
const button = document.getElementById("copy"); const button = document.getElementById("copy");
button.classList.remove("hidden");
button.onclick = () => { button.onclick = () => {
if (!navigator.clipboard) { if (!navigator.clipboard) {
button.innerText = "nicht unterstützt"; button.innerText = "nicht unterstützt";

View File

@ -39,6 +39,7 @@ input,
select, select,
textarea, textarea,
.button { .button {
display: inline-block;
background-color: var(--bg); background-color: var(--bg);
color: var(--fg); color: var(--fg);
padding: 0.5rem; padding: 0.5rem;
@ -48,6 +49,10 @@ textarea,
max-width: calc(100vw - 3rem - 4px); max-width: calc(100vw - 3rem - 4px);
} }
*.hidden {
display: none;
}
input[type="checkbox"] { input[type="checkbox"] {
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
} }

View File

@ -13,7 +13,7 @@
datei-link: datei-link:
<a id="link" class="copy-content" href="{url}">{url}</a> <a id="link" class="copy-content" href="{url}">{url}</a>
</p> </p>
<button id="copy" class="main button">link kopieren</button> <button id="copy" class="main button hidden">link kopieren</button>
</main> </main>
<script src="/static/copy.js" lang="javascript"></script> <script src="/static/copy.js" lang="javascript"></script>
</body> </body>

View File

@ -14,7 +14,7 @@
> >
<br /> <br />
<a class="main button" href="?dl">herunterladen</a> <a class="main button" href="?dl">herunterladen</a>
<button id="copy" class="button">text kopieren</button> <button id="copy" class="button hidden">text kopieren</button>
</main> </main>
<script src="/static/copy.js" lang="javascript"></script> <script src="/static/copy.js" lang="javascript"></script>
</body> </body>