simplify
This commit is contained in:
1 parent
58d3e58759
commit
c09e018bc5
4 files changed
+50
-44
No files matched your search
@@ -64,12 +64,15 @@ import qrcode_queue %}
|
||||
}
|
||||
|
||||
function filterQueue() {
|
||||
/** @type {HTMLInputElement} */
|
||||
const input = document.getElementById("search-input");
|
||||
const filter = input.value.toLowerCase();
|
||||
/** @type {NodeListOf<HTMLLIElement>} */
|
||||
const listItems = document.querySelectorAll(".queue-grid li");
|
||||
let visibleCount = 0;
|
||||
|
||||
listItems.forEach((li) => {
|
||||
/** @type {HTMLAnchorElement} */
|
||||
const link = li.querySelector("a");
|
||||
const text = link.textContent || link.innerText;
|
||||
if (text.toLowerCase().indexOf(filter) > -1) {
|
||||
@@ -79,10 +82,9 @@ import qrcode_queue %}
|
||||
li.style.display = "none";
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById(
|
||||
"count-display"
|
||||
).textContent = `Showing: ${visibleCount} / ${listItems.length}`;
|
||||
/** @type {HTMLParagraphElement} */
|
||||
const countDisplay = document.getElementById("count-display");
|
||||
countDisplay.textContent = `Showing: ${visibleCount} / ${listItems.length}`;
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user