File tree Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,8 @@ export default ({
2222 const location = useLocation ( ) ;
2323 const isActive = location && location . pathname . indexOf ( withPrefix ( to ) ) === 0 ;
2424
25- className += " toc-item" ;
26- if ( isActive || collapsed === false ) {
27- className += " toc-visible" ;
28- }
25+ const showSubtree = isActive || collapsed === false ;
26+ className += "toc-item" ;
2927
3028 return (
3129 < li className = { className } data-sidebar-branch >
@@ -34,7 +32,7 @@ export default ({
3432 </ SmartLink >
3533 { title && children && (
3634 < ul className = "list-unstyled" data-sidebar-tree >
37- { children }
35+ { showSubtree && children }
3836 </ ul >
3937 ) }
4038 </ li >
Original file line number Diff line number Diff line change 6868}
6969
7070[data-sidebar-branch ] [data-sidebar-branch ] > [data-sidebar-tree ] {
71- display : none ;
7271 margin-bottom : 0 ;
7372}
7473
75- [data-sidebar-branch ].toc-visible > [data-sidebar-tree ] {
76- display : block ;
77- }
78-
7974[data-sidebar-link ] {
8075 position : relative ;
8176 line-height : 1.5 ;
You can’t perform that action at this time.
0 commit comments