Skip to content

Commit 3a4ef0f

Browse files
Use an id instead of a function
1 parent 4b8ebbc commit 3a4ef0f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/librustdoc/html/static/main.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ function defocusSearchBar() {
9292
var disableShortcuts = getCurrentValue("rustdoc-disable-shortcuts") === "true";
9393
var search_input = getSearchInput();
9494
var searchTimeout = null;
95+
var toggleAllDocsId = "toggle-all-docs";
9596

9697
// On the search screen, so you remain on the last tab you opened.
9798
//
@@ -2113,12 +2114,8 @@ function defocusSearchBar() {
21132114
}
21142115
}
21152116

2116-
function getToggleAllDocsElement() {
2117-
return document.getElementById("toggle-all-docs");
2118-
}
2119-
21202117
function toggleAllDocs(pageId, fromAutoCollapse) {
2121-
var innerToggle = getToggleAllDocsElement();
2118+
var innerToggle = document.getElementById(toggleAllDocsId);
21222119
if (!innerToggle) {
21232120
return;
21242121
}
@@ -2360,7 +2357,7 @@ function defocusSearchBar() {
23602357
}
23612358

23622359
(function() {
2363-
var toggles = document.getElementById("toggle-all-docs");
2360+
var toggles = document.getElementById(toggleAllDocsId);
23642361
if (toggles) {
23652362
toggles.onclick = toggleAllDocs;
23662363
}

0 commit comments

Comments
 (0)