1 2//----------------------------------------------------------------------------------------- 3// 4// 5// Helper Functions 6// 7// 8//----------------------------------------------------------------------------------------- 9// 10//----------------------------------------------------------- 11// 12// Debounce 13// 14//----------------------------------------------------------- 15// 16function _debounce(func, wait, immediate) { 17 var timeout; 18 return function () { 19 var context = this, args = arguments; 20 var later = function () { 21 timeout = null; 22 if (!immediate) func.apply(context, args); 23 }; 24 var callNow = immediate && !timeout; 25 clearTimeout(timeout); 26 timeout = setTimeout(later, wait); 27 if (callNow) func.apply(context, args); 28 }; 29} 30//----------------------------------------------------------------------------------------- 31// 32// 33// Theme Functions 34// 35// 36//----------------------------------------------------------------------------------------- 37// 38// ----------------------------------------------------------- 39// 40// Root CSS 41// 42//----------------------------------------------------------- 43// 44function handleRootCSS() { 45 46 setRootCSS(); 47 48 $(window).on('resize', _debounce(function () { 49 setRootCSS(); 50 }, 250)); 51 52 $(document).on('click', '._js-reset-root-css', function () { 53 setRootCSS(); 54 }); 55 56 $(document).ajaxComplete(function () { 57 setRootCSS(); 58 }); 59 60 function setRootCSS() { 61 $('html').attr('style', 62 '--vh:' + ($(window).innerHeight() * 0.01).toFixed(2) + 'px;' + 63 '--header-height:' + $('.header-wrap').outerHeight() + 'px;' + 64 '--header-main-height:' + $('.header-main').outerHeight() + 'px;' 65 ); 66 } 67} 68 69$(document).ready(function () { 70 handleRootCSS(); 71});
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.