1(function() { 2 window.scrollToElement = function(element, offset = 0, isDynamicHeader = false) { 3 if (!element) { 4 return; 5 } 6 7 const rect = element.getBoundingClientRect(); 8 const scrollTop = window.scrollY || document.documentElement.scrollTop; 9 const currentTop = scrollTop; 10 const targetTop = rect.top + scrollTop; 11 12 if (isDynamicHeader) { 13 const helloBarLegacy = document.querySelector('.hello-bar-legacy'); 14 if (helloBarLegacy && window.innerWidth < 1280) { 15 const helloBarLegacyHeight = helloBarLegacy.offsetHeight; 16 const isScrollingDown = targetTop > currentTop; 17 offset = isScrollingDown ? (offset - helloBarLegacyHeight) : offset; 18 } else if (helloBarLegacy && window.innerWidth >= 1280 && targetTop > 0) { 19 const headerTopHeight = document.querySelector('.header__top-wrapper').offsetHeight; 20 offset = offset - headerTopHeight; 21 } 22 } 23 24 window.scrollTo({ 25 top: targetTop - offset, 26 behavior: 'smooth' 27 }); 28 }; 29})();
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.