@@ -905,7 +905,6 @@ function hideThemeButtonState() {
905
905
return ;
906
906
}
907
907
if ( hasClass ( innerToggle , "will-expand" ) ) {
908
- updateLocalStorage ( "rustdoc-collapse" , "false" ) ;
909
908
removeClass ( innerToggle , "will-expand" ) ;
910
909
onEachLazy ( document . getElementsByTagName ( "details" ) , function ( e ) {
911
910
e . open = true ;
@@ -920,7 +919,6 @@ function hideThemeButtonState() {
920
919
} ) ;
921
920
}
922
921
} else {
923
- updateLocalStorage ( "rustdoc-collapse" , "true" ) ;
924
922
addClass ( innerToggle , "will-expand" ) ;
925
923
onEachLazy ( document . getElementsByTagName ( "details" ) , function ( e ) {
926
924
e . open = false ;
@@ -1075,7 +1073,7 @@ function hideThemeButtonState() {
1075
1073
}
1076
1074
}
1077
1075
1078
- function collapser ( e , collapse ) {
1076
+ function collapseNonInherent ( e , collapse ) {
1079
1077
// inherent impl ids are like "impl" or impl-<number>'.
1080
1078
// they will never be hidden by default.
1081
1079
var n = e . parentElement ;
@@ -1087,28 +1085,6 @@ function hideThemeButtonState() {
1087
1085
}
1088
1086
}
1089
1087
1090
- function autoCollapse ( collapse ) {
1091
- if ( collapse ) {
1092
- toggleAllDocs ( true ) ;
1093
- } else if ( getSettingValue ( "auto-hide-trait-implementations" ) !== "false" ) {
1094
- var impl_list = document . getElementById ( "trait-implementations-list" ) ;
1095
-
1096
- if ( impl_list !== null ) {
1097
- onEachLazy ( impl_list . getElementsByClassName ( "collapse-toggle" ) , function ( e ) {
1098
- collapser ( e , collapse ) ;
1099
- } ) ;
1100
- }
1101
-
1102
- var blanket_list = document . getElementById ( "blanket-implementations-list" ) ;
1103
-
1104
- if ( blanket_list !== null ) {
1105
- onEachLazy ( blanket_list . getElementsByClassName ( "collapse-toggle" ) , function ( e ) {
1106
- collapser ( e , collapse ) ;
1107
- } ) ;
1108
- }
1109
- }
1110
- }
1111
-
1112
1088
function insertAfter ( newNode , referenceNode ) {
1113
1089
referenceNode . parentNode . insertBefore ( newNode , referenceNode . nextSibling ) ;
1114
1090
}
@@ -1167,6 +1143,22 @@ function hideThemeButtonState() {
1167
1143
var hideMethodDocs = getSettingValue ( "auto-hide-method-docs" ) === "true" ;
1168
1144
var hideImplementors = getSettingValue ( "auto-collapse-implementors" ) !== "false" ;
1169
1145
var hideLargeItemContents = getSettingValue ( "auto-hide-large-items" ) !== "false" ;
1146
+ var hideTraitImplementations =
1147
+ getSettingValue ( "auto-hide-trait-implementations" ) !== "false" ;
1148
+
1149
+ var impl_list = document . getElementById ( "trait-implementations-list" ) ;
1150
+ if ( impl_list !== null ) {
1151
+ onEachLazy ( impl_list . getElementsByClassName ( "collapse-toggle" ) , function ( e ) {
1152
+ collapseNonInherent ( e , collapse ) ;
1153
+ } ) ;
1154
+ }
1155
+
1156
+ var blanket_list = document . getElementById ( "blanket-implementations-list" ) ;
1157
+ if ( blanket_list !== null ) {
1158
+ onEachLazy ( blanket_list . getElementsByClassName ( "collapse-toggle" ) , function ( e ) {
1159
+ collapseNonInherent ( e , collapse ) ;
1160
+ } ) ;
1161
+ }
1170
1162
1171
1163
var func = function ( e ) {
1172
1164
var next = e . nextElementSibling ;
@@ -1353,8 +1345,6 @@ function hideThemeButtonState() {
1353
1345
onEachLazy ( document . getElementsByClassName ( "docblock" ) , buildToggleWrapper ) ;
1354
1346
onEachLazy ( document . getElementsByClassName ( "sub-variant" ) , buildToggleWrapper ) ;
1355
1347
1356
- autoCollapse ( getSettingValue ( "collapse" ) === "true" ) ;
1357
-
1358
1348
var pageId = getPageId ( ) ;
1359
1349
if ( pageId !== null ) {
1360
1350
expandSection ( pageId ) ;
0 commit comments