1// Close every dropdown if the user is not toggling it 2window.onclick = function(event) { 3 var target = event.target; 4 const geccoDropdownChild = target.closest('.gecco-dropdown-menu') 5 if ((target.getAttribute('data-toggle') !== 'gecco-dropdown') && !geccoDropdownChild) { 6 var dropdowns = document.getElementsByClassName("gecco-dropdown-menu"); 7 var i; 8 for (i = 0; i < dropdowns.length; i++) { 9 var openDropdown = dropdowns[i]; 10 if (openDropdown.classList.contains('open')) { 11 openDropdown.classList.remove('open'); 12 } 13 } 14 } 15 16}; 17 18const toggles = document.querySelectorAll("[data-toggle]"); 19 20for (let i = 0; i < toggles.length; i +=1) { 21 toggles[i].addEventListener('click', function(event) { 22 var target = event.currentTarget; 23 if (target.getAttribute('data-toggle') === 'gecco-flyout') { 24 document.getElementById('GeccoNav').classList.toggle('open'); 25 } 26 27 if (target.getAttribute('data-toggle') === 'gecco-dropdown') { 28 event.preventDefault(); 29 var dd = target.nextElementSibling; 30 dd.classList.toggle("open"); 31 } 32 33 }); 34}
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.