1/* Lets the browser decide when do execute a function */ 2var requestAnimationFrame = window.requestAnimationFrame || 3 window.mozRequestAnimationFrame || 4 window.webkitRequestAnimationFrame || 5 window.msRequestAnimationFrame; 6 7function setMaxModalHeight() { 8 var headerHeight = document.querySelector('.master-header').offsetHeight; 9 var footerHeight = document.querySelector('.master-footer').offsetHeight; 10 var headerFooterHeight = headerHeight + footerHeight ; 11 var maxModals = document.querySelectorAll('.MaxMsgBox'); 12 13 for (var i = 0, len = maxModals.length; i < len; ++i) { 14 maxModals[i].style.minHeight = 'calc(100vh - ' + headerFooterHeight + 'px)'; 15 } 16} 17 18document.addEventListener('DOMContentLoaded', function () { 19 window.addEventListener('resize', function () { 20 requestAnimationFrame(setMaxModalHeight); 21 }); 22}); 23 24function InitScrollDown() { 25 // Makes header fixed on scroll down. 26 window.addEventListener('scroll', function () { 27 var header = document.querySelector('.master-header'); 28 requestAnimationFrame(function () { 29 if (window.pageYOffset > header.offsetTop) { 30 document.body.classList.add('-fixed-header'); 31 setMaxModalHeight(); 32 } 33 else { 34 document.body.classList.remove('-fixed-header'); 35 setMaxModalHeight(); 36 } 37 }); 38 }); 39} 40 41 42
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.