all repos — searchix @ 12947e5a912ddcd6bb82cbaab2811d02de703871

Search engine for NixOS, nix-darwin, home-manager and NUR users

fix(js): switching source after reset uses old query
Alan Pearce alan@alanpearce.eu
Tue, 11 Mar 2025 12:40:33 +0100
commit

12947e5a912ddcd6bb82cbaab2811d02de703871

parent

bf3f752cf92eca939bdbfddd0a7ed06470b11ab5

1 files changed, 5 insertions(+), 0 deletions(-)

jump to
M frontend/static/search.jsfrontend/static/search.js
@@ -133,6 +133,11 @@ resultsRange.deleteContents();   state.results = "";
   history.pushState(state, null, ev.target.href);
   ev.preventDefault();
+  document.querySelectorAll("nav > a:not(.current)").forEach(function (node) {
+    const u = new URL(node.href);
+    u.search = "";
+    node.href = u.toString();
+  });
   queryInput.value = "";
 });