1Drupal.behaviors.verticaleMenuExed = { 2 attach: (context, settings) => { 3 once('verticaleMenuExed', '.js-custom-exed-nav-item', context).forEach( 4 (navItem) => { 5 navItem.addEventListener('click', () => { 6 const childWrapper = navItem.closest('.header--exed-nav__item').querySelector('.collapse'); 7 const childItem = childWrapper.querySelector('.js-custom-exed-nav-item[aria-expanded="true"]'); 8 const siblingItem = navItem.closest('.header--exed-nav__list').querySelector(`.js-custom-exed-nav-item[aria-expanded="true"][data-lvl="${navItem.dataset.lvl}"]`); 9 10 if (navItem.ariaExpanded === "true") { 11 childItem && trigger(childItem, 'click'); 12 } else { 13 siblingItem && trigger(siblingItem, 'click'); 14 } 15 }); 16 } 17 ); 18 19 const setVerticalMenuHeight = () => { 20 const verticalMenu = document.querySelector('.js-verticale-menu-exed', context); 21 22 if (verticalMenu) { 23 const menuHeight = verticalMenu.offsetHeight; 24 document.documentElement.style.setProperty('--verticalMenuExedHeight', `${menuHeight}px`); 25 } 26 }; 27 28 if (document.querySelector('.js-verticale-menu-exed')) { 29 setVerticalMenuHeight(); 30 window.addEventListener('resize', setVerticalMenuHeight); 31 } 32 } 33};
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.