Skip to content

Commit 6622111

Browse files
committed
main.js: always refer to searchState through window.searchState
1 parent da5da99 commit 6622111

File tree

1 file changed

+5
-10
lines changed
  • src/librustdoc/html/static/js

1 file changed

+5
-10
lines changed

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

+5-10
Original file line numberDiff line numberDiff line change
@@ -522,13 +522,10 @@ function preLoadCss(cssUrl) {
522522
* @param {KeyboardEvent} ev
523523
*/
524524
function handleEscape(ev) {
525-
// @ts-expect-error
526-
searchState.clearInputTimeout();
527-
// @ts-expect-error
528-
searchState.hideResults();
525+
window.searchState.clearInputTimeout();
526+
window.searchState.hideResults();
529527
ev.preventDefault();
530-
// @ts-expect-error
531-
searchState.defocus();
528+
window.searchState.defocus();
532529
window.hideAllModals(true); // true = reset focus for tooltips
533530
}
534531

@@ -563,8 +560,7 @@ function preLoadCss(cssUrl) {
563560
case "S":
564561
case "/":
565562
ev.preventDefault();
566-
// @ts-expect-error
567-
searchState.focus();
563+
window.searchState.focus();
568564
break;
569565

570566
case "+":
@@ -1699,8 +1695,7 @@ function preLoadCss(cssUrl) {
16991695
addSidebarCrates();
17001696
onHashChange(null);
17011697
window.addEventListener("hashchange", onHashChange);
1702-
// @ts-expect-error
1703-
searchState.setup();
1698+
window.searchState.setup();
17041699
}());
17051700

17061701
// Hide, show, and resize the sidebar

0 commit comments

Comments
 (0)