1(function () { 2 'use strict'; 3 4 function initMobileMenu() 5 { 6 // Handle main mobile menu toggle 7 const mobileToggleButton = document.querySelector('[data-dropdown-toggle="navbar-dropdown"]'); 8 const mobileMenu = document.getElementById('navbar-dropdown'); 9 10 if (mobileToggleButton && mobileMenu) { 11 mobileToggleButton.addEventListener( 12 'click', function (e) { 13 e.preventDefault(); 14 15 const isHidden = mobileMenu.style.display === 'none' || mobileMenu.style.display === ''; 16 17 if (isHidden) { 18 // Show menu 19 mobileMenu.style.display = 'block'; 20 mobileMenu.style.position = 'static'; 21 mobileMenu.style.zIndex = ''; 22 mobileMenu.style.visibility = ''; 23 mobileMenu.style.top = ''; 24 mobileMenu.style.left = ''; 25 mobileToggleButton.setAttribute('aria-expanded', 'true'); 26 } else { 27 // Hide menu 28 mobileMenu.style.display = 'none'; 29 mobileToggleButton.setAttribute('aria-expanded', 'false'); 30 } 31 } 32 ); 33 } 34 35 // Handle all dropdown toggles (submenus) 36 const dropdownToggles = document.querySelectorAll('[data-dropdown-toggle]'); 37 38 dropdownToggles.forEach( 39 function (toggle) { 40 const targetId = toggle.getAttribute('data-dropdown-toggle'); 41 const target = document.getElementById(targetId); 42 43 if (!target || targetId === 'navbar-dropdown') { 44 return; // Skip if no target or if it's the main mobile menu (handled above) 45 } 46 47 toggle.addEventListener( 48 'click', function (e) { 49 e.preventDefault(); 50 51 const isHidden = target.classList.contains('hidden'); 52 53 if (isHidden) { 54 // Show submenu 55 target.classList.remove('hidden'); 56 target.classList.add('block'); 57 // Clear any positioning styles from dropdown.js 58 target.style.position = ''; 59 target.style.zIndex = ''; 60 target.style.visibility = ''; 61 target.style.top = ''; 62 target.style.left = ''; 63 toggle.setAttribute('aria-expanded', 'true'); 64 } else { 65 // Hide submenu 66 target.classList.remove('block'); 67 target.classList.add('hidden'); 68 toggle.setAttribute('aria-expanded', 'false'); 69 } 70 } 71 ); 72 } 73 ); 74 } 75 76 // Initialize when DOM is ready 77 if (document.readyState === 'loading') { 78 document.addEventListener('DOMContentLoaded', initMobileMenu); 79 } else { 80 initMobileMenu(); 81 } 82})();
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.