File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
src/librustdoc/html/static Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -862,6 +862,12 @@ function hideThemeButtonState() {
862
862
displayHelp ( true , ev ) ;
863
863
} ) ;
864
864
865
+ onEachLazy ( document . getElementsByTagName ( "summary" ) , function ( el ) {
866
+ el . addEventListener ( "click" , function ( ev ) {
867
+ addClass ( el , "used" ) ;
868
+ } ) ;
869
+ } )
870
+
865
871
onEachLazy ( document . getElementsByTagName ( "a" ) , function ( el ) {
866
872
// For clicks on internal links (<A> tags with a hash property), we expand the section we're
867
873
// jumping to *before* jumping there. We can't do this in onHashChange, because it changes
Original file line number Diff line number Diff line change @@ -1487,11 +1487,21 @@ details.rustdoc-toggle[open] > summary.hideme > span {
1487
1487
display : none;
1488
1488
}
1489
1489
1490
- details .rustdoc-toggle [open ] > summary ::before {
1490
+ /* If a toggle has been used to open a section, we should make sure */
1491
+ /* there's a [-] so it can be closed again. But if a toggle is open */
1492
+ /* and has never been used, don't show it. This minimizes clutter on */
1493
+ /* the page while still supporting the "auto hide <X>" settings and */
1494
+ /* the expand/collapse all functionality. */
1495
+ details .rustdoc-toggle [open ] > summary .used ::before {
1491
1496
content : "[−]" ;
1492
1497
display : inline;
1493
1498
}
1494
1499
1500
+ details .rustdoc-toggle [open ] > summary ::before {
1501
+ content : "" ;
1502
+ display : inline;
1503
+ }
1504
+
1495
1505
details .undocumented > summary ::before {
1496
1506
content : "[+] Show hidden undocumented items" ;
1497
1507
cursor : pointer;
You can’t perform that action at this time.
0 commit comments