@@ -1887,12 +1887,30 @@ if (!DOMTokenList.prototype.remove) {
1887
1887
updateLocalStorage ( "rustdoc-collapse" , "true" ) ;
1888
1888
addClass ( innerToggle , "will-expand" ) ;
1889
1889
onEveryMatchingChild ( innerToggle , "inner" , function ( e ) {
1890
- e . innerHTML = labelForToggleButton ( true ) ;
1890
+ var parent = e . parentNode ;
1891
+ var superParent = null ;
1892
+
1893
+ if ( parent ) {
1894
+ superParent = parent . parentNode ;
1895
+ }
1896
+ if ( ! parent || ! superParent || superParent . id !== "main" ||
1897
+ hasClass ( parent , "impl" ) === false ) {
1898
+ e . innerHTML = labelForToggleButton ( true ) ;
1899
+ }
1891
1900
} ) ;
1892
1901
innerToggle . title = "expand all docs" ;
1893
1902
if ( fromAutoCollapse !== true ) {
1894
1903
onEachLazy ( document . getElementsByClassName ( "collapse-toggle" ) , function ( e ) {
1895
- collapseDocs ( e , "hide" , pageId ) ;
1904
+ var parent = e . parentNode ;
1905
+ var superParent = null ;
1906
+
1907
+ if ( parent ) {
1908
+ superParent = parent . parentNode ;
1909
+ }
1910
+ if ( ! parent || ! superParent || superParent . id !== "main" ||
1911
+ hasClass ( parent , "impl" ) === false ) {
1912
+ collapseDocs ( e , "hide" , pageId ) ;
1913
+ }
1896
1914
} ) ;
1897
1915
}
1898
1916
}
0 commit comments