1let initUiBindings = false; 2let mainScript = { 3 init: function () { 4 5 // Initialization header search 6 let searchIcon = document.getElementById('header-search-icon'); 7 if (searchIcon) { 8 searchIcon.addEventListener('click', this.toggleHeaderSearch); 9 } 10 let searchIconClose = document.getElementById('header-search-close'); 11 if (searchIconClose) { 12 searchIconClose.addEventListener('click', this.toggleHeaderSearch); 13 } 14 15 // Initialize scroll event for header background color change 16 window.removeEventListener('scroll', this.HeaderScrollEffect); 17 window.addEventListener('scroll', this.HeaderScrollEffect); 18 19 // Initialize UI bindings 20 if (!initUiBindings) { 21 this.uiBindings(); 22 initUiBindings = true; 23 } 24 25 // Initialize scroll event for header background color change 26 this.headerSearchPosition(); 27 window.removeEventListener('resize', this.headerSearchPosition); 28 window.addEventListener('resize', this.headerSearchPosition); 29 30 // 31 window.removeEventListener('load', this.setMapMarkertAttributes); 32 window.addEventListener('load', this.setMapMarkertAttributes); 33 }, 34 uiBindings: function () { 35 const dropdownMenus = document.querySelectorAll('.dropdown-menu'); 36 if (!dropdownMenus.length) return; 37 38 const hash = window.location.hash.substring(1); 39 40 dropdownMenus.forEach(menuToggle => { 41 const dropdownMenuItems = menuToggle.querySelectorAll('.elementor-nav-menu--dropdown .elementor-item-anchor'); 42 if (!dropdownMenuItems.length) return; 43 44 // Create active item display element 45 const tabElm = document.createElement('span'); 46 tabElm.classList.add('dropdown-active-item'); 47 const menuToggleBtn = menuToggle.querySelector('.elementor-menu-toggle'); 48 if (!menuToggleBtn) return; 49 50 menuToggleBtn.prepend(tabElm); 51 tabElm.textContent = dropdownMenuItems[0].textContent; 52 53 // Setup menu items 54 dropdownMenuItems.forEach(menuItem => { 55 // Set active item based on URL hash 56 if (hash && menuItem.getAttribute('href') === '#' + hash) { 57 tabElm.textContent = menuItem.textContent; 58 } 59 60 // Handle click events 61 menuItem.addEventListener('click', function () { 62 tabElm.textContent = this.textContent; 63 menuToggleBtn.click(); 64 }); 65 }); 66 }); 67 }, 68 toggleHeaderSearch: function (e) { 69 e.preventDefault(); 70 document.body.classList.toggle('open-header-search'); 71 }, 72 headerSearchPosition: function () { 73 var searchBar = document.getElementById('header-search'), headerElm = document.getElementById('header'); 74 if (searchBar && headerElm) { 75 if (window.innerWidth < 768) { 76 searchBar.style.top = headerElm.offsetHeight + 'px'; 77 } else { 78 searchBar.style.top = ''; 79 } 80 } 81 }, 82 HeaderScrollEffect: function () { 83 // Get the header element 84 const header = document.getElementById('main-header'); 85 if (!header) return; 86 if (window.scrollY > 0) { // Change after scrolling 0px 87 header.style.backgroundColor = 'var(--e-global-color-primary, #3B4F65)'; 88 } else { 89 header.style.backgroundColor = ''; 90 } 91 }, 92 setMapMarkertAttributes: function () { 93 const mapMarkers = document.querySelectorAll('.wpgmp_map div[role="button"]'); 94 if (!mapMarkers.length) return; 95 mapMarkers.forEach(marker => { 96 marker.setAttribute('title', 'Map Marker'); 97 }); 98 } 99}; 100 101mainScript.init();
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.