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