Skip to content

Commit 2a80d67

Browse files
committed
Cleaning code.
1 parent 7ec0a8b commit 2a80d67

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

src/components/overrides/Sidebar.astro

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ const [product, module] = Astro.url.pathname.split("/").filter(Boolean);
5252

5353
if (!searchInput || !sidebarContent || !noResultsMessage || !globalSearchLink) return;
5454

55-
let originalState: Map<Element, boolean> = new Map();
56-
let isSearchActive = false;
55+
const originalState: Map<Element, boolean> = new Map();
5756

5857
// Store original state of details elements
5958
function storeOriginalState() {
@@ -65,25 +64,6 @@ const [product, module] = Astro.url.pathname.split("/").filter(Boolean);
6564
}
6665
}
6766

68-
// Show all contents within a folder recursively
69-
function showAllContentsInFolder(element: Element) {
70-
// Show the element itself
71-
(element as HTMLElement).style.display = '';
72-
73-
// If it's a details element, open it
74-
if (element.tagName === 'DETAILS') {
75-
(element as HTMLDetailsElement).open = true;
76-
}
77-
78-
// Recursively show all children
79-
const children = element.children;
80-
for (let i = 0; i < children.length; i++) {
81-
const child = children[i];
82-
if (child.tagName === 'LI' || child.tagName === 'DETAILS' || child.tagName === 'UL') {
83-
showAllContentsInFolder(child);
84-
}
85-
}
86-
}
8767

8868
// Check if text matches all search terms (for multi-word searches)
8969
function matchesAllTerms(text: string, searchTerms: string[]): boolean {
@@ -139,12 +119,10 @@ const [product, module] = Astro.url.pathname.split("/").filter(Boolean);
139119
// Hide no results message
140120
noResultsMessage.classList.add('hidden');
141121

142-
isSearchActive = false;
143122
clearButton.style.display = 'none';
144123
return;
145124
}
146125

147-
isSearchActive = true;
148126
clearButton.style.display = 'block';
149127

150128
// Split search query into terms for more precise matching

0 commit comments

Comments
 (0)