diff --git a/index.html b/index.html index 3d91df8..17e1c6a 100644 --- a/index.html +++ b/index.html @@ -4,12 +4,14 @@

{{ site.tagline }}

-
- - - -
-
+
+
+ + + +
+
+
diff --git a/shared/search.js b/shared/search.js index c04eb1d..d149e50 100644 --- a/shared/search.js +++ b/shared/search.js @@ -1,6 +1,17 @@ +const formEl = document.getElementById('search-form'); const inputEl = document.getElementById('search'); const tools = Array.from(document.getElementById('tools').children); +formEl.addEventListener('submit', ev => { + ev.preventDefault(); + + const visibleMenuItems = document.querySelectorAll("#tools > a:not([hidden])"); + + if (visibleMenuItems.length === 1) { + window.location.href = visibleMenuItems[0].getAttribute("href"); + } +}) + inputEl.addEventListener('input', ev => { const searchQuery = ev.target.value.trim().toLowerCase();