This commit is contained in:
@@ -23,6 +23,17 @@
|
||||
try { localStorage.setItem("vacatureradar-theme", next); } catch { /* Current page still updates. */ }
|
||||
});
|
||||
|
||||
const globalSearch = document.getElementById("global-search");
|
||||
globalSearch?.form?.addEventListener("submit", () => {
|
||||
const query = globalSearch.value.trim();
|
||||
if (!query) return;
|
||||
try {
|
||||
const previous = JSON.parse(localStorage.getItem("vacatureradar-recent-searches") || "[]");
|
||||
const recent = [query, ...previous.filter((item) => item !== query)].slice(0, 5);
|
||||
localStorage.setItem("vacatureradar-recent-searches", JSON.stringify(recent));
|
||||
} catch { /* Zoeken werkt ook zonder lokale geschiedenis. */ }
|
||||
});
|
||||
|
||||
const closeNavigation = () => {
|
||||
frame?.classList.remove("nav-open");
|
||||
navToggle?.setAttribute("aria-expanded", "false");
|
||||
|
||||
Reference in New Issue
Block a user