normalization optimized

This commit is contained in:
Roland committed 2026-08-03 21:51:54 +00:00
1 parent bfc6128353
commit bd23858537
8 files changed
+95 -46

No files matched your search

+4 -4
View File
@@ -11,11 +11,11 @@
const table = document.getElementById('software-inventory-table');
if (filter && table) {
filter.addEventListener('input', () => {
const normalize = window.AssetManagerNormalizeSearchText ||
((value) => String(value || '').toLocaleLowerCase());
const needle = normalize(filter.value.trim());
const matches = window.AssetManagerSearchTextMatches ||
((value, term) => String(value || '').toLocaleLowerCase().includes(String(term || '').toLocaleLowerCase()));
const needle = filter.value.trim();
table.querySelectorAll('tbody tr').forEach((row) => {
row.hidden = Boolean(needle) && !normalize(row.textContent).includes(needle);
row.hidden = Boolean(needle) && !matches(row.textContent, needle);
});
});
}