diff options
Diffstat (limited to 'assets/js/main.js')
| -rw-r--r-- | assets/js/main.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/assets/js/main.js b/assets/js/main.js index dfb6d75..6ba0f19 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -17,7 +17,7 @@ const label = isDarkMode ? toggleThemeBtn.dataset.labelLight : toggleThemeBtn.dataset.labelDark; rootHtml.setAttribute("data-theme", theme); - toggleThemeBtn.setAttribute("aria-label", label); + toggleThemeBtn.setAttribute("aria-label", label); // display handled by CSS } // Apply initial theme @@ -57,16 +57,17 @@ resultsList.hidden = true; } - // Hydrate post-card list item(s) from the template with JSON data function renderSearchResults(matches) { clearResults(); + // Display how many results found for query resultsCount.hidden = false; resultsCount.querySelector("#search-results-number").textContent = String(matches.length ?? 0); // No posts matching query found if (!matches.length) return; + // Hydrate post-card list item(s) from the template with JSON data matches.forEach((post) => { const li = template.content.firstElementChild.cloneNode(true); |
