Skip to content

Commit 4ba862c

Browse files
committed
Use 'const' instead of 'var'
1 parent 48be20b commit 4ba862c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/supplemental-ui/js/landing-page-support.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@
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
}

0 commit comments

Comments
 (0)