@@ -92,6 +92,7 @@ function defocusSearchBar() {
92
92
var disableShortcuts = getCurrentValue ( "rustdoc-disable-shortcuts" ) === "true" ;
93
93
var search_input = getSearchInput ( ) ;
94
94
var searchTimeout = null ;
95
+ var toggleAllDocsId = "toggle-all-docs" ;
95
96
96
97
// On the search screen, so you remain on the last tab you opened.
97
98
//
@@ -1397,8 +1398,8 @@ function defocusSearchBar() {
1397
1398
// "current" is used to know which tab we're looking into.
1398
1399
var current = 0 ;
1399
1400
onEachLazy ( document . getElementById ( "results" ) . childNodes , function ( e ) {
1400
- onEachLazy ( e . getElementsByClassName ( "highlighted" ) , function ( e ) {
1401
- actives [ current ] . push ( e ) ;
1401
+ onEachLazy ( e . getElementsByClassName ( "highlighted" ) , function ( h_e ) {
1402
+ actives [ current ] . push ( h_e ) ;
1402
1403
} ) ;
1403
1404
current += 1 ;
1404
1405
} ) ;
@@ -2121,7 +2122,7 @@ function defocusSearchBar() {
2121
2122
}
2122
2123
2123
2124
function toggleAllDocs ( pageId , fromAutoCollapse ) {
2124
- var innerToggle = document . getElementById ( "toggle-all-docs" ) ;
2125
+ var innerToggle = document . getElementById ( toggleAllDocsId ) ;
2125
2126
if ( ! innerToggle ) {
2126
2127
return ;
2127
2128
}
@@ -2314,11 +2315,6 @@ function defocusSearchBar() {
2314
2315
}
2315
2316
}
2316
2317
2317
- var toggles = document . getElementById ( "toggle-all-docs" ) ;
2318
- if ( toggles ) {
2319
- toggles . onclick = toggleAllDocs ;
2320
- }
2321
-
2322
2318
function insertAfter ( newNode , referenceNode ) {
2323
2319
referenceNode . parentNode . insertBefore ( newNode , referenceNode . nextSibling ) ;
2324
2320
}
@@ -2368,6 +2364,11 @@ function defocusSearchBar() {
2368
2364
}
2369
2365
2370
2366
( function ( ) {
2367
+ var toggles = document . getElementById ( toggleAllDocsId ) ;
2368
+ if ( toggles ) {
2369
+ toggles . onclick = toggleAllDocs ;
2370
+ }
2371
+
2371
2372
var toggle = createSimpleToggle ( false ) ;
2372
2373
var hideMethodDocs = getCurrentValue ( "rustdoc-auto-hide-method-docs" ) === "true" ;
2373
2374
var hideImplementors = getCurrentValue ( "rustdoc-auto-collapse-implementors" ) !== "false" ;
0 commit comments