1BX.ready(function () { 2 const url = window.location.href; 3 const mobileQuery = window.matchMedia('(max-width: 767.98px)'); 4 5 function moveWhyBlock() { 6 if (!mobileQuery.matches) return; 7 8 document.querySelectorAll('.bxw-blocks-wrapper__menu').forEach(function(menuWrapper) { 9 const wrapper = Array.prototype.filter.call(menuWrapper.children, function(child) { 10 return child.classList.contains('bxw-blocks-wrapper'); 11 })[0]; 12 13 if (!wrapper) return; 14 15 const whyBlock = Array.prototype.filter.call(wrapper.children, function(child) { 16 return child.classList.contains('bxw-block-why'); 17 })[0]; 18 19 if (!whyBlock) return; 20 21 const nextWrapper = ( 22 menuWrapper.nextElementSibling 23 && menuWrapper.nextElementSibling.classList.contains('bxw-blocks-wrapper') 24 ) ? menuWrapper.nextElementSibling : wrapper; 25 26 if (nextWrapper.lastElementChild !== whyBlock) { 27 nextWrapper.appendChild(whyBlock); 28 } 29 }); 30 } 31 32 moveWhyBlock(); 33 34 if (mobileQuery.addEventListener) { 35 mobileQuery.addEventListener('change', moveWhyBlock); 36 } else { 37 mobileQuery.addListener(moveWhyBlock); 38 } 39 40 document.querySelectorAll('.bxw-sticky-menu__link[href^="#"]').forEach(function(link) { 41 link.addEventListener('click', function(event) { 42 const hash = link.getAttribute('href') 43 const element = document.querySelector(hash) 44 45 if (!hash || !element) return 46 47 event.preventDefault() 48 history.pushState(null, '', hash) 49 window.scrollTo({ 50 top: element.getBoundingClientRect().top + window.pageYOffset - 170, 51 }) 52 }); 53 }); 54 55 if (url.endsWith('#') || url.includes('#')) { 56 setTimeout(function() { 57 let urlHash = url.split("#")[1]; 58 const element = document.querySelector('#' + urlHash); 59 const elementOffsetTop = element.offsetTop; 60 61 window.scrollTo({ 62 top: elementOffsetTop - 120, 63 }); 64 }, 800); 65 } 66 67 window.addEventListener('scroll', () => { 68 let scrollDistance = window.scrollY + 120; 69 if (window.innerWidth > 991) { 70 document.querySelectorAll('.menu_target').forEach((el, i) => { 71 if (el.offsetTop - document.querySelector('.bxw-sticky-menu__content').clientHeight <= scrollDistance) { 72 document.querySelectorAll('.bxw-sticky-menu__item').forEach((el) => { 73 if (el.classList.contains('active')) { 74 el.classList.remove('active'); 75 }; 76 }); 77 78 document.querySelectorAll('.bxw-sticky-menu__item')[i].classList.add('active'); 79 }; 80 }); 81 }; 82 },{passive: true}); 83});
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.