1requirejs([ 2 'domReady!' 3], function () { 4 'use strict'; 5 6 (function(window, document) { 7 var headerTop = 0; 8 var body = document.body; 9 10 // Calculate top header height to init fixed header 11 var topHeader = document.querySelector('.top-header'); 12 var headerHome = document.querySelector('.header-home'); 13 14 if (topHeader) { 15 headerTop += topHeader.offsetHeight; 16 } 17 18 if (headerHome) { 19 headerTop += headerHome.offsetHeight; 20 } 21 22 // Fixed header when scrolling down 23 var fixHeader = function() { 24 if (window.scrollY >= headerTop) { 25 body.classList.add('fixed-header'); 26 } else { 27 body.classList.remove('fixed-header'); 28 } 29 } 30 31 // Window scroll event 32 window.addEventListener('scroll', function(e) { 33 fixHeader(); 34 }); 35 36 fixHeader(); 37 })(window, document); 38});
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.