(filteredCount)
| 857 | } |
| 858 | |
| 859 | function updateCounts(filteredCount) { |
| 860 | if (!countEl) return; |
| 861 | const total = entries.length; |
| 862 | if (filteredCount !== total) { |
| 863 | countEl.textContent = filteredCount + ' of ' + total + ' items'; |
| 864 | } else { |
| 865 | countEl.textContent = total + ' items'; |
| 866 | } |
| 867 | } |
| 868 | |
| 869 | function applyFilter() { |
| 870 | const term = (searchEl && searchEl.value) ? searchEl.value.trim().toLowerCase() : ''; |