assets/js/nav/megaNav/megaNav.js in kcc-gem-theme-2.14.1 vs assets/js/nav/megaNav/megaNav.js in kcc-gem-theme-2.14.2
- old
+ new
@@ -1,13 +1,14 @@
import toggleMenuOnWindowResize from './toggleMenuOnWindowResize.js';
import toggleDropdownOnWindowResize from './toggleDropdownOnWindowResizeTwo.js';
import googleCustomSearchInit from './googleCustomSearch.js';
import closeMenuOnClick from './closeMegaNavOnClick.js';
-import underlineCurrentSite from './underlineCurrentSite.js';
-document.addEventListener('DOMContentLoaded', function() {
+export default function megaNav() {
googleCustomSearchInit();
- underlineCurrentSite();
+ if (window.location.pathname == '/') {
+ import('./underlineCurrentSite').then(({default: underlineCurrentSite}) => underlineCurrentSite())
+ }
toggleMenuOnWindowResize();
toggleDropdownOnWindowResize();
closeMenuOnClick();
-});
+}