File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 3535( function ( ) {
3636 'use strict'
3737
38- var navbarBurger = document . querySelector ( '.navbar-burger' )
38+ const navbarBurger = document . querySelector ( '.navbar-burger' ) ;
3939 if ( ! navbarBurger ) return
4040 navbarBurger . addEventListener ( 'click' , toggleNavbarMenu . bind ( navbarBurger ) )
4141
4242 function toggleNavbarMenu ( e ) {
4343 e . stopPropagation ( ) // trap event
4444 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" ) ;
4747 if ( menu . classList . toggle ( 'is-active' ) ) {
4848 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 ) ;
5151 if ( actualMaxHeight !== expectedMaxHeight ) menu . style . maxHeight = expectedMaxHeight + 'px'
5252 }
5353 }
You can’t perform that action at this time.
0 commit comments