Compare commits
No commits in common. "e3c620edc9c3a69d6c2ad59effc246b64f817f10" and "c8df9a33014b24da84d06ac7985691c9098da8af" have entirely different histories.
e3c620edc9
...
c8df9a3301
@ -148,7 +148,6 @@ main {
|
||||
}
|
||||
|
||||
a {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% macro print_recipe(recipe) %}
|
||||
<article data-title="{{ recipe.title | lower }}"
|
||||
<article
|
||||
{% if recipe.taxonomies.tagy %}
|
||||
{% for tag in recipe.taxonomies.tagy %}
|
||||
{% if tag == "pikantní" %}
|
||||
|
@ -21,10 +21,6 @@ let input = document.getElementById("input");
|
||||
input.oninput = function() { filter_name(input.value) };
|
||||
let articles = document.getElementsByTagName("article");
|
||||
|
||||
for (let i=0; i<articles.length; i++) {
|
||||
articles[i].dataset.title = articles[i].dataset.title.normalize("NFD").replace(/\p{Diacritic}/gu, "");
|
||||
}
|
||||
|
||||
function filter_name(str) {
|
||||
str = str.toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "");
|
||||
|
||||
@ -34,7 +30,12 @@ function filter_name(str) {
|
||||
}
|
||||
} else {
|
||||
for (let i=0; i<articles.length; i++) {
|
||||
articles[i].style.display = !articles[i].dataset.title.includes(str) ? "none" : "flex";
|
||||
let name = articles[i].getElementsByClassName("title")[0].innerHTML.toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "");
|
||||
if (!name.includes(str)) {
|
||||
articles[i].style.display = "none";
|
||||
} else {
|
||||
articles[i].style.display = "flex";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user