1// Mobile Menu Toggle - MiniCRM.one 2(function() { 3 'use strict'; 4 5 function initMobileMenu() { 6 var menuButton = document.querySelector('.gv-btn-menu'); 7 var navLinks = document.querySelector('.gv-nav-links'); 8 9 if (!menuButton || !navLinks) { 10 console.log('Mobile menu elements not found'); 11 return; 12 } 13 14 console.log('Mobile menu initialized'); 15 16 // Toggle menu on button click 17 menuButton.addEventListener('click', function(e) { 18 e.preventDefault(); 19 e.stopPropagation(); 20 21 var isActive = navLinks.classList.contains('active'); 22 23 if (isActive) { 24 navLinks.classList.remove('active'); 25 menuButton.setAttribute('aria-expanded', 'false'); 26 console.log('Menu closed'); 27 } else { 28 navLinks.classList.add('active'); 29 menuButton.setAttribute('aria-expanded', 'true'); 30 console.log('Menu opened'); 31 } 32 }); 33 34 // Close menu when clicking outside 35 document.addEventListener('click', function(e) { 36 var isClickInsideMenu = navLinks.contains(e.target); 37 var isClickOnButton = menuButton.contains(e.target); 38 39 if (!isClickInsideMenu && !isClickOnButton && navLinks.classList.contains('active')) { 40 navLinks.classList.remove('active'); 41 menuButton.setAttribute('aria-expanded', 'false'); 42 console.log('Menu closed (click outside)'); 43 } 44 }); 45 46 // Close menu when clicking a nav link 47 var navLinksItems = navLinks.querySelectorAll('a'); 48 navLinksItems.forEach(function(link) { 49 link.addEventListener('click', function() { 50 navLinks.classList.remove('active'); 51 menuButton.setAttribute('aria-expanded', 'false'); 52 console.log('Menu closed (link clicked)'); 53 }); 54 }); 55 } 56 57 // Initialize when DOM is ready 58 if (document.readyState === 'loading') { 59 document.addEventListener('DOMContentLoaded', initMobileMenu); 60 } else { 61 initMobileMenu(); 62 } 63})();
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.