From: Ardis Lu Date: Fri, 6 Jun 2025 03:47:34 +0000 (-0700) Subject: Do not show copy-permalink button if there is no text in the input X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=4993c8be6a3052981eff32295bb7d8601d9a1f30;p=event-hashes Do not show copy-permalink button if there is no text in the input There is no reason to copy a permalink to a blank input, so it is just confusing to be there at all times. --- diff --git a/index.html b/index.html index bd792bb..68ed960 100644 --- a/index.html +++ b/index.html @@ -80,6 +80,7 @@ label { font-weight: 700; + padding-block: 8px; } button, @@ -206,6 +207,7 @@ } } + #copy-permalink, #clear-code { display: none; } @@ -417,9 +419,11 @@ // Input has been cleared, reset back to default state if (textarea.value === '') { + document.querySelector('#copy-permalink').style.display = 'none'; document.querySelector('#clear-code').style.display = 'none'; return; } + document.querySelector('#copy-permalink').style.display = 'unset'; const events = getEvents(textarea.value); const uniqueEvents = Array.from(new Set(events));