1(function () { 2 const sidebar = document.querySelector('.page-sidebar'); 3 const footer = document.querySelector('.page-footer'); 4 5 /** 6 * Sticky Sidebar 7 */ 8 if (sidebar) { 9 const STICKY_SCROLL_OFFSET = 379; 10 11 const updateSidebar = () => { 12 const scrolledPastOffset = 13 window.scrollY >= STICKY_SCROLL_OFFSET; 14 15 let footerVisible = false; 16 17 if (footer) { 18 const footerRect = footer.getBoundingClientRect(); 19 20 footerVisible = 21 footerRect.top < window.innerHeight && 22 footerRect.bottom > 0; 23 } 24 25 sidebar.classList.toggle( 26 'active', 27 scrolledPastOffset && !footerVisible 28 ); 29 }; 30 31 sidebar.classList.remove('active'); 32 updateSidebar(); 33 34 window.addEventListener('scroll', updateSidebar, { 35 passive: true, 36 }); 37 38 window.addEventListener('resize', updateSidebar); 39 } 40})();
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.