1/******/ (() => { // webpackBootstrap 2/*!***********************************************************!*\ 3 !*** ./src/scripts/gutenberg/blocks/classic-menu/view.js ***! 4 \***********************************************************/ 5document.addEventListener("DOMContentLoaded", () => { 6 // Event delegation on the menu root to keep things simple & resilient 7 document.querySelectorAll(".wp-block-madden-theme-classic-menu").forEach(menuRoot => { 8 menuRoot.addEventListener("click", e => { 9 // Support both .menu-item-toggle and (optionally) parent <a> clicks 10 const toggle = e.target.closest(".menu-item-toggle, .menu-item-has-children > a"); 11 if (!toggle || !menuRoot.contains(toggle)) return; 12 if (toggle.classList.contains("menu-item-toggle")) { 13 e.preventDefault(); 14 e.stopPropagation(); 15 const menuItem = toggle.closest(".menu-item"); 16 if (!menuItem) return; 17 const wasOpen = menuItem.classList.contains("is-toggled"); 18 19 // 1) Close any open items in THIS menu 20 menuRoot.querySelectorAll(".menu-item.is-toggled").forEach(el => { 21 el.classList.remove("is-toggled"); 22 }); 23 24 // 2) Open the clicked one only if it wasn't already open 25 if (!wasOpen) { 26 menuItem.classList.add("is-toggled"); 27 } 28 } 29 }); 30 }); 31}); 32/******/ })() 33; 34//# sourceMappingURL=view.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.