forked from em/receptty.org
Optimalizace vyhledávání
This commit is contained in:
parent
73e50a719c
commit
fb740e8639
@ -4,7 +4,7 @@
|
||||
<main>
|
||||
<h2>Hledání a filtry</h2>
|
||||
<div class="filters">
|
||||
<input type="text" placeholder="Název" oninput="filter_name(this.value)">
|
||||
<input type="text" placeholder="Název" id="input">
|
||||
</div>
|
||||
<section class="list">
|
||||
{% set section = get_section(path="_index.md") %}
|
||||
@ -17,8 +17,11 @@
|
||||
|
||||
{% block script %}
|
||||
<script>
|
||||
let input = document.getElementById("input");
|
||||
input.oninput = function() { filter_name(input.value) };
|
||||
let articles = document.getElementsByTagName("article");
|
||||
|
||||
function filter_name(str) {
|
||||
let articles = document.getElementsByTagName("article");
|
||||
str = str.toLowerCase();
|
||||
|
||||
if (str.length==0) {
|
||||
|
Loading…
Reference in New Issue
Block a user