(function() { document.addEventListener('DOMContentLoaded', function() { var dropdowns = document.querySelectorAll('.navbar-nav .nav-item.dropdown'); dropdowns.forEach(function(dropdown) { var showTimeout, hideTimeout; dropdown.addEventListener('mouseenter', function() { var menu = dropdown.querySelector(':scope > .dropdown-menu'); clearTimeout(hideTimeout); showTimeout = setTimeout(function() { if (menu != null) menu.classList.add('show'); }, 1000); }); dropdown.addEventListener('mouseleave', function() { var menu = dropdown.querySelector(':scope > .dropdown-menu'); clearTimeout(showTimeout); hideTimeout = setTimeout(function() { if (menu != null) menu.classList.remove('show'); }, 500); }); }); }); }).call(this);