File tree Expand file tree Collapse file tree 2 files changed +12
-23
lines changed Expand file tree Collapse file tree 2 files changed +12
-23
lines changed Original file line number Diff line number Diff line change @@ -554,20 +554,3 @@ div.highlight span.c-Singleline, div.highlight span.c {
554
554
}
555
555
}
556
556
}
557
-
558
- /* hide TOC */
559
- .hiddenTOC {
560
- font-size : 0 ;
561
- margin : 0 ;
562
- opacity : 0 ;
563
- padding : 0 ;
564
- /* fade out, then shrink */
565
- transition : opacity .25s , font-size .5s .25s , margin .5s .25s , padding .5s .25s ;
566
-
567
- }
568
-
569
- /* reveal TOC */
570
- .shownTOC {
571
- /* unshrink, then fade in */
572
- transition : font-size .25s , margin .25s , padding .25s , opacity .5s .25s ;
573
- }
Original file line number Diff line number Diff line change @@ -39,9 +39,7 @@ function setup_collapsible_TOC() {
39
39
40
40
state = Cookies . get ( 'toc_state' ) || 'shown' ;
41
41
if ( state == 'hidden' ) {
42
- $ ( '#TOC' ) . find ( 'tbody' ) . addClass ( 'hiddenTOC' ) ;
43
- } else {
44
- $ ( '#TOC' ) . find ( 'tbody' ) . addClass ( 'shownTOC' ) ;
42
+ $ ( 'nav.indexgroup > ol' ) . hide ( ) ;
45
43
}
46
44
47
45
$ ( 'nav.indexgroup' ) . find ( '#TOC_Title' )
@@ -53,9 +51,17 @@ function setup_collapsible_TOC() {
53
51
. find ( '#TOC_toggle_button' )
54
52
. click ( function ( ) {
55
53
var el = $ ( this ) ;
56
- el . text ( el . text ( ) == '[hide]' ? '[show]' : '[hide]' ) ;
57
- Cookies . set ( 'toc_state' , el . text ( ) == '[hide]' ? 'shown' : 'hidden' ) ;
58
- el . parents ( 'nav' ) . find ( 'tbody' ) . toggleClass ( 'hiddenTOC' ) . toggleClass ( 'shownTOC' ) ;
54
+ if ( el . text ( ) == '[hide]' ) {
55
+ Cookies . set ( 'toc_state' , 'hidden' ) ;
56
+ el . parents ( 'nav' ) . find ( 'tbody' ) . slideUp ( ) ;
57
+ el . text ( '[show]' ) ;
58
+ }
59
+ else {
60
+ Cookies . set ( 'toc_state' , 'shown' ) ;
61
+ el . parents ( 'nav' ) . find ( 'tbody' ) . slideDown ( ) ;
62
+ el . text ( '[hide]' ) ;
63
+ }
64
+
59
65
return false ;
60
66
} ) ;
61
67
}
You can’t perform that action at this time.
0 commit comments