Molecule 7/7: ansible_remote_tmp fix
Test & Deploy Hugo Docker CMS / test-and-deploy (push) Successful in 4m18s
Test & Deploy Hugo Docker CMS / test-and-deploy (push) Successful in 4m18s
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
let pagefind = null;
|
||||
let timer = null;
|
||||
let currentItems = [];
|
||||
|
||||
async function getPagefind() {
|
||||
if (!pagefind) pagefind = await import("/pagefind/pagefind.js");
|
||||
@@ -20,6 +21,7 @@
|
||||
}
|
||||
|
||||
function render(items) {
|
||||
currentItems = items;
|
||||
if (!items.length) {
|
||||
results.innerHTML = '<p class="search-empty">Keine Treffer.</p>';
|
||||
results.hidden = false;
|
||||
@@ -55,6 +57,7 @@
|
||||
if (query.length < 2) {
|
||||
results.hidden = true;
|
||||
results.innerHTML = "";
|
||||
currentItems = [];
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -90,6 +93,13 @@
|
||||
if (input.value.trim().length >= 2) doSearch(input.value);
|
||||
});
|
||||
|
||||
input.addEventListener("keydown", (e) => {
|
||||
if (e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
if (currentItems.length) window.location.href = currentItems[0].url;
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener("click", (e) => {
|
||||
if (!e.target.closest(".search")) results.hidden = true;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user