1'use strict'; 2 3function init() { 4 const globalNav = document.querySelector('.js-global-navigation'); 5 const globalHeader = document.querySelector('.global-header'); 6 const scrollContainer = document.querySelector('.js-global-navigation'); 7 8 if (globalNav && globalHeader && scrollContainer) { 9 var myScrollFunc = function() { 10 var y = scrollContainer.scrollTop; 11 12 if (globalNav.classList.contains('is-toggled')) { 13 if (y >= globalHeader.offsetHeight - 50 ) { 14 globalHeader.classList.add('navigation-scroll'); 15 } else { 16 globalHeader.classList.remove('navigation-scroll'); 17 } 18 } 19 }; 20 21 scrollContainer.addEventListener('scroll', myScrollFunc, { passive: true }); 22 } 23} 24 25init();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.