update search.js

This commit is contained in:
Alex Nuttall 2024-12-07 15:11:16 +00:00
parent 25ce0875ad
commit 7096531205
No known key found for this signature in database
GPG key ID: AB4F43428A2DD256

View file

@ -95,6 +95,9 @@
let totalResults = 0;
// Firsttype-ahead-signature", show/hide all the sub-entries within each module (top-level functions etc.)
searchTypeAhead.querySelectorAll("li").forEach((entry) => {
const entryModule = entry
.querySelector(".type-ahead-module-name")
.textContent.toLowerCase()
const entryName = entry
.querySelector(".type-ahead-def-name")
.textContent.toLowerCase();
@ -103,7 +106,9 @@
?.textContent?.toLowerCase()
?.replace(/\s+/g, "");
if ((entryName.includes(text) || entrySignature?.includes(text.replace(/\s+/g, "")))) {
const qualifiedEntryName = `${entryModule}.${entryName}`
if ((qualifiedEntryName.includes(text) || entrySignature?.includes(text.replace(/\s+/g, "")))) {
totalResults++;
entry.classList.remove("hidden");
if (topSearchResultListItem === undefined) {