refactor ciagl dalszy
This commit is contained in:
1 parent
01b8ff656e
commit
bc45c91d92
15 files changed
+1592
-1492
No files matched your search
@@ -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