@@ -1886,12 +1886,30 @@ if (!DOMTokenList.prototype.remove) {
18861886 updateLocalStorage ( "rustdoc-collapse" , "true" ) ;
18871887 addClass ( innerToggle , "will-expand" ) ;
18881888 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+ }
18901899 } ) ;
18911900 innerToggle . title = "expand all docs" ;
18921901 if ( fromAutoCollapse !== true ) {
18931902 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+ }
18951913 } ) ;
18961914 }
18971915 }
0 commit comments