]> git.ardis.lu - event-hashes/commitdiff
Do not show copy-permalink button if there is no text in the input
authorArdis Lu <ardisglu@gmail.com>
Fri, 6 Jun 2025 03:47:34 +0000 (20:47 -0700)
committerArdis Lu <ardisglu@gmail.com>
Fri, 6 Jun 2025 03:47:34 +0000 (20:47 -0700)
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

index bd792bbe956da4d6c3e2506501c0408891b25441..68ed9608f8343c9ffe35d1537c51a06d0155f108 100644 (file)
@@ -80,6 +80,7 @@
 
     label {
       font-weight: 700;
+      padding-block: 8px;
     }
 
     button,
       }
     }
 
+    #copy-permalink,
     #clear-code {
       display: none;
     }
 
       // 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));
This page took 0.046229 seconds and 4 git commands to generate.