From 4993c8be6a3052981eff32295bb7d8601d9a1f30 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Thu, 5 Jun 2025 20:47:34 -0700 Subject: [PATCH] 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. --- index.html | 4 ++++ 1 file changed, 4 insertions(+) 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)); -- 2.47.3