Optimalizace vyhledávání
This commit is contained in:
		| @@ -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> | ||||
| function filter_name(str) { | ||||
| let input = document.getElementById("input"); | ||||
| input.oninput = function() { filter_name(input.value) }; | ||||
| let articles = document.getElementsByTagName("article"); | ||||
|  | ||||
| function filter_name(str) { | ||||
| 	str = str.toLowerCase(); | ||||
|  | ||||
| 	if (str.length==0) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user