1
Fork 0

main.js: give type signatures to a few helper functions

This commit is contained in:
binarycat 2025-03-10 13:24:33 -05:00
parent 93161f5c14
commit cf7f3cf424

View file

@ -322,7 +322,6 @@ function preLoadCss(cssUrl) {
search = window.searchState.outputElement();
}
switchDisplayedElement(search);
window.searchState.mouseMovedAfterSearch = false;
document.title = window.searchState.title;
},
removeQueryParameters: () => {
@ -499,17 +498,22 @@ function preLoadCss(cssUrl) {
handleHashes(ev);
}
// @ts-expect-error
/**
* @param {HTMLElement|null} elem
*/
function openParentDetails(elem) {
while (elem) {
if (elem.tagName === "DETAILS") {
// @ts-expect-error
elem.open = true;
}
elem = elem.parentNode;
elem = elem.parentElement;
}
}
// @ts-expect-error
/**
* @param {string} id
*/
function expandSection(id) {
openParentDetails(document.getElementById(id));
}