File tree 1 file changed +5
-5
lines changed 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 35
35
( function ( ) {
36
36
'use strict'
37
37
38
- var navbarBurger = document . querySelector ( '.navbar-burger' )
38
+ const navbarBurger = document . querySelector ( '.navbar-burger' ) ;
39
39
if ( ! navbarBurger ) return
40
40
navbarBurger . addEventListener ( 'click' , toggleNavbarMenu . bind ( navbarBurger ) )
41
41
42
42
function toggleNavbarMenu ( e ) {
43
43
e . stopPropagation ( ) // trap event
44
44
document . classList . toggle ( 'is-clipped--navbar' )
45
- navbarBurger . setAttribute ( 'aria-expanded' , document . classList . contains ( 'is-clipped--navbar' ) )
46
- var menu = document . getElementById ( "topbar-nav" )
45
+ navbarBurger . setAttribute ( 'aria-expanded' , document . classList . contains ( 'is-clipped--navbar' ) . toString ( ) )
46
+ const menu = document . getElementById ( "topbar-nav" ) ;
47
47
if ( menu . classList . toggle ( 'is-active' ) ) {
48
48
menu . style . maxHeight = ''
49
- var expectedMaxHeight = window . innerHeight - Math . round ( menu . getBoundingClientRect ( ) . top )
50
- var actualMaxHeight = parseInt ( window . getComputedStyle ( menu ) . maxHeight , 10 )
49
+ const expectedMaxHeight = window . innerHeight - Math . round ( menu . getBoundingClientRect ( ) . top ) ;
50
+ const actualMaxHeight = parseInt ( window . getComputedStyle ( menu ) . maxHeight , 10 ) ;
51
51
if ( actualMaxHeight !== expectedMaxHeight ) menu . style . maxHeight = expectedMaxHeight + 'px'
52
52
}
53
53
}
You can’t perform that action at this time.
0 commit comments