in site-ui/src/js/06-nav.js [43:57]
function fitNavMenuInit (e) {
window.removeEventListener('scroll', fitNavMenuOnScroll)
navMenu.element.style.height = ''
if ((navMenu.preferredHeight = navMenu.element.getBoundingClientRect().height) > 0) {
// QUESTION should we check if x value > 0 instead?
if (window.getComputedStyle(nav).visibility === 'visible') {
if (!navMenu.encroachingElement) navMenu.encroachingElement = document.querySelector('footer.footer')
fitNavMenu(navMenu.preferredHeight, (navMenu.viewHeight = window.innerHeight), navMenu.encroachingElement)
window.addEventListener('scroll', fitNavMenuOnScroll)
}
if (currentPageItem && e.type !== 'resize') {
scrollItemToMiddle(currentPageItem.querySelector('.nav-link'), navMenu.element)
}
}
}