File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ document.addEventListener('DOMContentLoaded', () => {
3434 var arr = current_location . split ( "/" )
3535 var regx = / \/ v [ 0 - 9 \. ] + /
3636 if ( regx . test ( current_location ) ) {
37- window . location = window . location . href . replace ( regx , `${ target_version } ` )
37+ window . location = window . location . href . replace ( regx , `/ ${ target_version } ` )
3838 } else {
3939 window . location = `/${ target_version } ${ current_location } `
4040 }
@@ -60,4 +60,16 @@ document.addEventListener('DOMContentLoaded', () => {
6060 $menuTarget . classList . toggle ( 'is-hidden-touch' ) ;
6161 } ) ;
6262 } ) ;
63+
64+ // Table of contents
65+ const $tocController = document . getElementById ( "toc" ) ;
66+ if ( $tocController ) {
67+ $tocController . addEventListener ( 'click' , ( ) => {
68+ $tocController . classList . toggle ( 'is-active' ) ;
69+ const target = $tocController . dataset . target ;
70+ const $target = document . getElementById ( target ) ;
71+ $target . classList . toggle ( 'is-hidden-touch' ) ;
72+ } )
73+ }
74+
6375} ) ;
You can’t perform that action at this time.
0 commit comments