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() {
862862 displayHelp ( true , ev ) ;
863863 } ) ;
864864
865+ onEachLazy ( document . getElementsByTagName ( "summary" ) , function ( el ) {
866+ el . addEventListener ( "click" , function ( ev ) {
867+ addClass ( el , "used" ) ;
868+ } ) ;
869+ } )
870+
865871 onEachLazy ( document . getElementsByTagName ( "a" ) , function ( el ) {
866872 // For clicks on internal links (<A> tags with a hash property), we expand the section we're
867873 // 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 {
14871487 display : none;
14881488}
14891489
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 {
14911496 content : "[−]" ;
14921497 display : inline;
14931498}
14941499
1500+ details .rustdoc-toggle [open ] > summary ::before {
1501+ content : "" ;
1502+ display : inline;
1503+ }
1504+
14951505details .undocumented > summary ::before {
14961506 content : "[+] Show hidden undocumented items" ;
14971507 cursor : pointer;
You can’t perform that action at this time.
0 commit comments