refactor ciagl dalszy
This commit is contained in:
11
static/js/stats.js
Normal file
11
static/js/stats.js
Normal file
@@ -0,0 +1,11 @@
|
||||
document.addEventListener('input', (e) => {
|
||||
const el = e.target.closest('[data-action="filter-table"]');
|
||||
if (!el) return;
|
||||
const table = document.querySelector(el.getAttribute('data-target') || '');
|
||||
if (!table) return;
|
||||
const q = (el.value || '').toLowerCase();
|
||||
table.querySelectorAll('tbody tr').forEach(tr => {
|
||||
const text = (tr.innerText || tr.textContent || '').toLowerCase();
|
||||
tr.style.display = text.includes(q) ? '' : 'none';
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user