File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,14 +11,14 @@ <h1 class="h0-mktg lh-condensed text-center mb-3">{{ page.title }}</h1>
1111 < p class ="lead text-center text-gray col-md-8 mx-auto mb-4 position-relative "> {{ page.description }}</ p >
1212 < nav class ="toc mb-4 mb-md-6 ">
1313 < div class ="Box col-sm-8 col-md-4 col-lg-3 mx-auto ">
14- < a class ="toc-trigger d-block text-center p-3 ">
14+ < button type =" button " class ="toc-trigger d-block text-center p-3 " aria-expanded =" false " aria-controls =" toc-list ">
1515 < span class ="text-black "> {{ t.article.table_of_contents }}</ span > < svg height ="18 "
1616 class ="octicon octicon-triangle-down ml-2 fill-blue v-align-middle icon-flip " viewBox ="0 0 12 16 "
17- version ="1.1 " width ="13 " role =" img ">
17+ version ="1.1 " width ="13 " aria-hidden =" true " focusable =" false ">
1818 < path fill-rule ="evenodd " d ="M0 5l6 6 6-6z "> </ path >
1919 </ svg >
20- </ a >
21- {% include jekyll-toc.html html=content h_max=2 ordered=true class="toc-list list-style-none"
20+ </ button >
21+ {% include jekyll-toc.html html=content h_max=2 ordered=true id="toc-list" class="toc-list list-style-none"
2222 item_class="border-top" anchor_class="d-block py-3 px-3" %}
2323 </ div >
2424 </ nav >
Original file line number Diff line number Diff line change 88}
99
1010.toc-trigger {
11+ width : 100% ;
12+ background : transparent ;
13+ border : 0 ;
14+ font : inherit ;
15+ color : inherit ;
16+
1117 & :hover {
1218 text-decoration : none ;
1319 cursor : pointer ;
Original file line number Diff line number Diff line change 11$ ( function ( ) {
22 $ ( document ) . click ( function ( ) {
33 // Hiding ToC
4- $ ( '.toc-trigger' ) . removeClass ( 'toc-open' ) ;
4+ $ ( '.toc-trigger' ) . removeClass ( 'toc-open' ) . attr ( 'aria-expanded' , 'false' ) ;
55 $ ( '.toc-list' ) . removeClass ( 'is-shown' ) ;
66 } ) ;
77
@@ -10,7 +10,8 @@ $(function() {
1010 // Prevent bubbling event for proper hiding
1111 e . stopPropagation ( ) ;
1212 // Calling a function in case you want to expand upon this.
13- $ ( this ) . toggleClass ( 'toc-open' ) ;
13+ var $trigger = $ ( this ) . toggleClass ( 'toc-open' ) ;
14+ $trigger . attr ( 'aria-expanded' , $trigger . hasClass ( 'toc-open' ) ? 'true' : 'false' ) ;
1415 $ ( '.toc-list' ) . toggleClass ( 'is-shown' ) ;
1516 } ) ;
1617} ) ;
You can’t perform that action at this time.
0 commit comments