normalization optimized
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user