From 65b45815b60b82ace8fae767836f1981394b0178 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Wed, 7 Jun 2023 10:33:46 +0200 Subject: [PATCH 1/3] Fix exception when clicking preis label. Not sure what's going on. --- site/utils.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/site/utils.js b/site/utils.js index 6ab2014..bf0043a 100644 --- a/site/utils.js +++ b/site/utils.js @@ -299,7 +299,7 @@ function itemToDOM(item) { priceHistory += ` ${date} -
€ ${currPrice}
@@ -365,11 +365,11 @@ function itemToDOM(item) { if (pricesDom.classList.contains("hidden")) { pricesDom.classList.remove("hidden"); pricesDom.ariaHidden = false; - target.innerHTML = "▲"; + if (target) target.innerHTML = "▲"; } else { pricesDom.classList.add("hidden"); pricesDom.ariaHidden = true; - target.innerHTML = "▼"; + if (target) target.innerHTML = "▼"; } }); }); @@ -566,7 +566,7 @@ function newSearchComponent(parentElement, items, searched, filter, headerModifi - + - +
diff --git a/site/utils.js b/site/utils.js index bf0043a..3033830 100644 --- a/site/utils.js +++ b/site/utils.js @@ -64,6 +64,9 @@ const stores = { const STORE_KEYS = Object.keys(stores); const BUDGET_BRANDS = [...new Set([].concat(...Object.values(stores).map((store) => store.budgetBrands)))]; +// how many chars to enter before search is triggered +const MIN_QUERY_LENGTH = 3; + /** * @description Returns the current date in ISO format * @returns {string} ISO date string in format YYYY-MM-DD @@ -412,7 +415,7 @@ const UNITS = { function searchItems(items, query, checkedStores, budgetBrands, minPrice, maxPrice, exact, bio) { query = query.trim(); - if (query.length < 3 || checkedStores.length == 0) return []; + if (query.length < MIN_QUERY_LENGTH || checkedStores.length == 0) return []; if (query.charAt(0) == "!") { query = query.substring(1); @@ -533,7 +536,7 @@ function newSearchComponent(parentElement, items, searched, filter, headerModifi parentElement.innerHTML = ""; parentElement.innerHTML = `
- +
${customCheckbox(`all-${id}`, " Alle", true, "gray", "gray")} ${STORE_KEYS.map((store) => From b8eca155c9169b54b5500ef89e6c118091f12dae Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Wed, 7 Jun 2023 13:31:43 +0200 Subject: [PATCH 3/3] Vendor tailwind. --- site/_templates/_header.html | 2 +- site/js/tailwind.js | 17157 +++++++++++++++++++++++++++++++++ 2 files changed, 17158 insertions(+), 1 deletion(-) create mode 100644 site/js/tailwind.js diff --git a/site/_templates/_header.html b/site/_templates/_header.html index 34d3538..a965038 100644 --- a/site/_templates/_header.html +++ b/site/_templates/_header.html @@ -9,7 +9,7 @@ rel="icon" href="data:image/svg+xml,🔥" /> - +