Fix: Debouncer into search engine. 350ms after last entry before live search.
This commit is contained in:
@@ -216,21 +216,22 @@ gridtv/
|
|||||||
└── src/
|
└── src/
|
||||||
├── config.php # Config loader + migration
|
├── config.php # Config loader + migration
|
||||||
├── tpl/ # HTML templates
|
├── tpl/ # HTML templates
|
||||||
│ ├── head.php
|
│ ├── head.php # DOCTYPE, <head>, CSS
|
||||||
│ ├── topbar.php
|
│ ├── topbar.php # Topbar (nav, source switcher, search, theme)
|
||||||
│ ├── grid.php
|
│ ├── grid.php # Grid + mobile + PiP + overlays
|
||||||
│ ├── modals.php
|
│ ├── modals.php # Personal EPG modal
|
||||||
│ └── footer.php
|
│ └── footer.php # JS modules loader, </body></html>
|
||||||
└── js/ # JavaScript modules
|
└── js/ # JavaScript modules
|
||||||
├── config.js # Constants + PHP-injected vars
|
├── config.js # Constants + PHP-injected vars
|
||||||
├── utils.js # Helpers, clock, EPG fetch
|
├── utils.js # Helpers, clock, EPG fetch
|
||||||
├── epg.js # Grid rendering
|
├── epg.js # Grid rendering
|
||||||
├── mobile.js # Mobile list view
|
├── mobile.js # Mobile list view
|
||||||
├── tooltip.js # Hover tooltip
|
├── tooltip.js # Hover tooltip
|
||||||
├── sources.js # Multi-EPG switcher
|
├── sources.js # Multi-EPG switcher + Personal EPG
|
||||||
├── m3u.js # M3U parser
|
├── m3u.js # M3U parser
|
||||||
├── player.js # HLS PiP player
|
├── player.js # HLS PiP player
|
||||||
├── themes.js # Theme switcher
|
├── themes.js # Theme switcher
|
||||||
|
├── search.js # Search + filter (debounced)
|
||||||
└── live.js # Live updates + responsive
|
└── live.js # Live updates + responsive
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
+6
-2
@@ -1,6 +1,7 @@
|
|||||||
// ── SEARCH ────────────────────────────────────────────────────────────────────
|
// ── SEARCH ────────────────────────────────────────────────────────────────────
|
||||||
let searchActive = false;
|
let searchActive = false;
|
||||||
let searchQuery = '';
|
let searchQuery = '';
|
||||||
|
let searchTimer = null;
|
||||||
|
|
||||||
function toggleSearch() {
|
function toggleSearch() {
|
||||||
const bar = document.getElementById('searchBar');
|
const bar = document.getElementById('searchBar');
|
||||||
@@ -21,8 +22,11 @@ function clearSearch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onSearchInput(val) {
|
function onSearchInput(val) {
|
||||||
searchQuery = val.trim().toLowerCase();
|
clearTimeout(searchTimer);
|
||||||
applySearch(searchQuery);
|
searchTimer = setTimeout(() => {
|
||||||
|
searchQuery = val.trim().toLowerCase();
|
||||||
|
applySearch(searchQuery);
|
||||||
|
}, 350);
|
||||||
}
|
}
|
||||||
|
|
||||||
function applySearch(q) {
|
function applySearch(q) {
|
||||||
|
|||||||
Reference in New Issue
Block a user