clear search filter on back navigation
This commit is contained in:
parent
7ebccc793a
commit
605c25b8b0
1 changed files with 9 additions and 0 deletions
|
|
@ -242,6 +242,15 @@ def index():
|
||||||
const items = document.querySelectorAll('.app-item');
|
const items = document.querySelectorAll('.app-item');
|
||||||
const categories = document.querySelectorAll('.category');
|
const categories = document.querySelectorAll('.category');
|
||||||
|
|
||||||
|
window.addEventListener('pageshow', () => {{
|
||||||
|
input.value = '';
|
||||||
|
categories.forEach(cat => {{
|
||||||
|
cat.style.display = '';
|
||||||
|
cat.querySelectorAll('.app-item').forEach(item => item.style.display = '');
|
||||||
|
}});
|
||||||
|
input.focus();
|
||||||
|
}});
|
||||||
|
|
||||||
input.addEventListener('input', () => {{
|
input.addEventListener('input', () => {{
|
||||||
const q = input.value.toLowerCase().trim();
|
const q = input.value.toLowerCase().trim();
|
||||||
let visible = [];
|
let visible = [];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue