1import { 2 init_modal_v1 3} from "./chunk-5NUE6T5P.js"; 4import { 5 CF2Component, 6 init_runtime, 7 registerComponent 8} from "./chunk-NQUHJ6NR.js"; 9import { 10 init_define_process 11} from "./chunk-RFSPGZ3L.js"; 12
13// projects/lib/packages/yggdrasil-blueprints/__generated__/packs/navigation-v1.ts 14init_define_process(); 15
16// projects/lib/packages/yggdrasil-blueprints/__generated__/blueprints/navigation-v1.ts 17init_define_process(); 18init_modal_v1(); 19init_runtime(); 20var NavigationV1 = class extends CF2Component { 21 constructor(el, runtimeSel) { 22 super(el, runtimeSel); 23 } 24 mount(el) { 25 const modal = this.getComponent("Modal/V1"); 26 const navigationItems = document.querySelectorAll(".elNavigation-menu-dropdown"); 27 const navigationSubItems = document.querySelectorAll(".elNavigation-menu-dropdown-item"); 28 this.handleDropdownDirection(navigationItems); 29 this.handleDropdownDirection(navigationSubItems); 30 this.setupModalOpen(this.element, modal.element); 31 this.setupModalCloseOnLinkClick(this.element, modal); 32 } 33 setupModalCloseOnLinkClick(nav, modal) { 34 const [mobileContainer] = nav.getElementsByClassName("elNavigatorMobile"); 35 if (!mobileContainer) return; 36 mobileContainer.addEventListener("click", (e) => { 37 const link = e.target.closest("a"); 38 if (link && mobileContainer.contains(link)) { 39 modal.close(); 40 } 41 }); 42 } 43 handleDropdownDirection(items) { 44 items.forEach((navItem) => { 45 navItem.addEventListener( 46 "mouseenter", 47 (e) => this.determineDirection(e.target.querySelectorAll(".elNavigation-menu-dropdown-holder")[0]) 48 ); 49 navItem.addEventListener( 50 "mouseleave", 51 (e) => this.removeDirectionClasses(e.target.querySelectorAll(".elNavigation-menu-dropdown-holder")[0]) 52 ); 53 }); 54 } 55 setupModalOpen(nav, modal) { 56 const [mobileMenu] = nav.getElementsByClassName("elNavigatorButton"); 57 mobileMenu.addEventListener("click", function() { 58 document.documentElement.classList.add("hide-page-scroll"); 59 modal.style.display = "flex"; 60 }); 61 } 62 determineDirection(element) { 63 let elementRect = element.getBoundingClientRect(); 64 if (elementRect.left + elementRect.width > window.innerWidth) { 65 element.parentElement.parentElement.classList.add("dropdown-open-left"); 66 } 67 if (elementRect.top + elementRect.height > window.innerHeight) { 68 element.parentElement.parentElement.classList.add("dropdown-open-top"); 69 } 70 } 71 removeDirectionClasses(element) { 72 element.parentElement.parentElement.classList.remove("dropdown-open-left", "dropdown-open-top"); 73 } 74}; 75registerComponent("Navigation/V1", NavigationV1); 76window["NavigationV1"] = NavigationV1; 77//# sourceMappingURL=navigation-v1-K6JQJRJ6.js.map
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.