Display item counter next to search form. #6

Merged
snoopy merged 5 commits from item-counter into main 2024-05-07 22:36:49 +02:00
2 changed files with 13 additions and 0 deletions
Showing only changes of commit 7406efc2fa - Show all commits

View file

@ -7,6 +7,11 @@ h1, h1 a {
color: #dfaa37; /* C4 Yellow */
}
#search.failed {
color: #200;
background-color: #ec6d5f;
}
#itemcount {
display: inline-block;
margin-right: 1ch;

View file

@ -95,6 +95,14 @@ function search(e) {
elem.classList.add('filtered');
}
}
// Indicate failed search.
if (count) {
e.target.classList.remove('failed');
} else {
e.target.classList.add('failed');
}
updateCounter(count);
}