Skip to content

Commit cf7f3cf

Browse files
committed
main.js: give type signatures to a few helper functions
1 parent 93161f5 commit cf7f3cf

File tree

1 file changed

+8
-4
lines changed
  • src/librustdoc/html/static/js

1 file changed

+8
-4
lines changed

Diff for: src/librustdoc/html/static/js/main.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ function preLoadCss(cssUrl) {
322322
search = window.searchState.outputElement();
323323
}
324324
switchDisplayedElement(search);
325-
window.searchState.mouseMovedAfterSearch = false;
326325
document.title = window.searchState.title;
327326
},
328327
removeQueryParameters: () => {
@@ -499,17 +498,22 @@ function preLoadCss(cssUrl) {
499498
handleHashes(ev);
500499
}
501500

502-
// @ts-expect-error
501+
/**
502+
* @param {HTMLElement|null} elem
503+
*/
503504
function openParentDetails(elem) {
504505
while (elem) {
505506
if (elem.tagName === "DETAILS") {
507+
// @ts-expect-error
506508
elem.open = true;
507509
}
508-
elem = elem.parentNode;
510+
elem = elem.parentElement;
509511
}
510512
}
511513

512-
// @ts-expect-error
514+
/**
515+
* @param {string} id
516+
*/
513517
function expandSection(id) {
514518
openParentDetails(document.getElementById(id));
515519
}

0 commit comments

Comments
 (0)