File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 8
8
function toggleNavbarMenu ( e ) {
9
9
e . stopPropagation ( ) // trap event
10
10
var html = document . documentElement
11
- var menu = document . getElementById ( this . dataset . target )
11
+ var menu = document . getElementById ( this . getAttribute ( 'aria-controls' ) || this . dataset . target )
12
12
if ( ! menu . classList . contains ( 'is-active' ) && / m o b i / i. test ( window . navigator . userAgent ) ) {
13
13
if ( Math . round ( parseFloat ( window . getComputedStyle ( html ) . minHeight ) ) !== window . innerHeight ) {
14
14
html . style . setProperty ( '--vh' , window . innerHeight / 100 + 'px' )
17
17
}
18
18
}
19
19
html . classList . toggle ( 'is-clipped--navbar' )
20
- this . classList . toggle ( 'is-active' )
20
+ navbarBurger . setAttribute ( 'aria-expanded' , this . classList . toggle ( 'is-active' ) )
21
21
menu . classList . toggle ( 'is-active' )
22
22
}
23
23
} ) ( )
Original file line number Diff line number Diff line change 3
3
<div class =" navbar-brand" >
4
4
<a class =" navbar-item logo" title =" Asciidoctor" href =" https://asciidoctor.org" ><img src =" {{{ uiRootPath }}} /img/asciidoctor-logo.svg" alt =" Asciidoctor" width =" 48" ></a >
5
5
<a class =" navbar-item title" href =" {{ #with (and site.url site.homeUrl )}} {{{ @root.site.url }}}{{{ this }}} {{ else }} {{{ siteRootPath }}} {{ /with }} " >{{ site.title }} </a >
6
- <button class =" navbar-burger" data-target =" topbar-nav" >
6
+ <button class =" navbar-burger" aria-controls =" topbar-nav" aria-expanded = " false " aria-label = " Toggle main menu " >
7
7
<span ></span >
8
8
<span ></span >
9
9
<span ></span >
You can’t perform that action at this time.
0 commit comments