Loading core/themes/olivero/js/second-level-navigation.es6.js +6 −6 Original line number Diff line number Diff line Loading @@ -7,13 +7,13 @@ /** * Shows and hides the specified menu item's second level submenu. * * @param {element} topLevelMenuITem - the <li> element that is the container for the menu and submenus. * @param {element} topLevelMenuItem - the <li> element that is the container for the menu and submenus. * @param {boolean} [toState] - Optional state where we want the submenu to end up. */ function toggleSubNav(topLevelMenuITem, toState) { function toggleSubNav(topLevelMenuItem, toState) { const buttonSelector = '.primary-nav__button-toggle, .primary-nav__menu-link--button'; const button = topLevelMenuITem.querySelector(buttonSelector); const button = topLevelMenuItem.querySelector(buttonSelector); const state = toState !== undefined ? toState Loading @@ -33,13 +33,13 @@ }); } button.setAttribute('aria-expanded', 'true'); topLevelMenuITem topLevelMenuItem .querySelector('.primary-nav__menu--level-2') .classList.add('is-active-menu-parent'); } else { button.setAttribute('aria-expanded', 'false'); topLevelMenuITem.classList.remove('is-touch-event'); topLevelMenuITem topLevelMenuItem.classList.remove('is-touch-event'); topLevelMenuItem .querySelector('.primary-nav__menu--level-2') .classList.remove('is-active-menu-parent'); } Loading core/themes/olivero/js/second-level-navigation.js +5 −5 Original line number Diff line number Diff line Loading @@ -9,9 +9,9 @@ var isDesktopNav = Drupal.olivero.isDesktopNav; var secondLevelNavMenus = document.querySelectorAll('.primary-nav__menu-item--has-children'); function toggleSubNav(topLevelMenuITem, toState) { function toggleSubNav(topLevelMenuItem, toState) { var buttonSelector = '.primary-nav__button-toggle, .primary-nav__menu-link--button'; var button = topLevelMenuITem.querySelector(buttonSelector); var button = topLevelMenuItem.querySelector(buttonSelector); var state = toState !== undefined ? toState : button.getAttribute('aria-expanded') !== 'true'; if (state) { Loading @@ -23,11 +23,11 @@ } button.setAttribute('aria-expanded', 'true'); topLevelMenuITem.querySelector('.primary-nav__menu--level-2').classList.add('is-active-menu-parent'); topLevelMenuItem.querySelector('.primary-nav__menu--level-2').classList.add('is-active-menu-parent'); } else { button.setAttribute('aria-expanded', 'false'); topLevelMenuITem.classList.remove('is-touch-event'); topLevelMenuITem.querySelector('.primary-nav__menu--level-2').classList.remove('is-active-menu-parent'); topLevelMenuItem.classList.remove('is-touch-event'); topLevelMenuItem.querySelector('.primary-nav__menu--level-2').classList.remove('is-active-menu-parent'); } } Loading Loading
core/themes/olivero/js/second-level-navigation.es6.js +6 −6 Original line number Diff line number Diff line Loading @@ -7,13 +7,13 @@ /** * Shows and hides the specified menu item's second level submenu. * * @param {element} topLevelMenuITem - the <li> element that is the container for the menu and submenus. * @param {element} topLevelMenuItem - the <li> element that is the container for the menu and submenus. * @param {boolean} [toState] - Optional state where we want the submenu to end up. */ function toggleSubNav(topLevelMenuITem, toState) { function toggleSubNav(topLevelMenuItem, toState) { const buttonSelector = '.primary-nav__button-toggle, .primary-nav__menu-link--button'; const button = topLevelMenuITem.querySelector(buttonSelector); const button = topLevelMenuItem.querySelector(buttonSelector); const state = toState !== undefined ? toState Loading @@ -33,13 +33,13 @@ }); } button.setAttribute('aria-expanded', 'true'); topLevelMenuITem topLevelMenuItem .querySelector('.primary-nav__menu--level-2') .classList.add('is-active-menu-parent'); } else { button.setAttribute('aria-expanded', 'false'); topLevelMenuITem.classList.remove('is-touch-event'); topLevelMenuITem topLevelMenuItem.classList.remove('is-touch-event'); topLevelMenuItem .querySelector('.primary-nav__menu--level-2') .classList.remove('is-active-menu-parent'); } Loading
core/themes/olivero/js/second-level-navigation.js +5 −5 Original line number Diff line number Diff line Loading @@ -9,9 +9,9 @@ var isDesktopNav = Drupal.olivero.isDesktopNav; var secondLevelNavMenus = document.querySelectorAll('.primary-nav__menu-item--has-children'); function toggleSubNav(topLevelMenuITem, toState) { function toggleSubNav(topLevelMenuItem, toState) { var buttonSelector = '.primary-nav__button-toggle, .primary-nav__menu-link--button'; var button = topLevelMenuITem.querySelector(buttonSelector); var button = topLevelMenuItem.querySelector(buttonSelector); var state = toState !== undefined ? toState : button.getAttribute('aria-expanded') !== 'true'; if (state) { Loading @@ -23,11 +23,11 @@ } button.setAttribute('aria-expanded', 'true'); topLevelMenuITem.querySelector('.primary-nav__menu--level-2').classList.add('is-active-menu-parent'); topLevelMenuItem.querySelector('.primary-nav__menu--level-2').classList.add('is-active-menu-parent'); } else { button.setAttribute('aria-expanded', 'false'); topLevelMenuITem.classList.remove('is-touch-event'); topLevelMenuITem.querySelector('.primary-nav__menu--level-2').classList.remove('is-active-menu-parent'); topLevelMenuItem.classList.remove('is-touch-event'); topLevelMenuItem.querySelector('.primary-nav__menu--level-2').classList.remove('is-active-menu-parent'); } } Loading