diff --git a/js/component_scripts.min.js b/js/component_scripts.min.js index 76107b6c86ca4d32efda60592db473261f047a75..33d5ece08964275a69cc15ded1d8c6c7dc738082 100644 --- a/js/component_scripts.min.js +++ b/js/component_scripts.min.js @@ -274,16 +274,12 @@ function toggleItem() { - console.log('CLICKED'); - var parent = this.parentNode.parentNode.parentNode.parentNode; var screenWidth = $(window).width(); if (this.classList.contains('submenu-active')) { - console.log('IF'); - this.classList.remove('submenu-active'); if (this.hasAttribute('aria-expanded', 'true')) { @@ -298,13 +294,14 @@ } } } else if ($('.submenu-active')) { - console.log('ELSEIF'); - // Get elements with .submnenu-active than close them, + // Get elements with .submnenu-active than close them, $('.submenu-active').removeClass('submenu-active').attr('aria-expanded', 'false'); + // and open this one. this.classList.add("submenu-active"); this.setAttribute('aria-expanded', 'true'); + // If hamburger if (screenWidth <= 767) { // Look at parents and hide other menus if not secondary and open @@ -314,7 +311,6 @@ } } } else { - console.log('ELSE'); this.classList.add('submenu-active'); this.setAttribute('aria-expanded', 'true'); } diff --git a/source/_patterns/04-components/menu/menu--horizontal/menu--horizontal.js b/source/_patterns/04-components/menu/menu--horizontal/menu--horizontal.js index b974f4f9bb408f898fa21471e9a2a67a1604d80f..b3465246a95aaa017aac2df7b6eb132a92001969 100644 --- a/source/_patterns/04-components/menu/menu--horizontal/menu--horizontal.js +++ b/source/_patterns/04-components/menu/menu--horizontal/menu--horizontal.js @@ -38,16 +38,12 @@ function toggleItem() { - console.log('CLICKED'); - var parent = this.parentNode.parentNode.parentNode.parentNode; var screenWidth = $(window).width(); if (this.classList.contains('submenu-active')) { - console.log('IF'); - this.classList.remove('submenu-active'); if (this.hasAttribute('aria-expanded', 'true')) { @@ -62,13 +58,14 @@ } } } else if ($('.submenu-active')) { - console.log('ELSEIF'); - // Get elements with .submnenu-active than close them, + // Get elements with .submnenu-active than close them, $('.submenu-active').removeClass('submenu-active').attr('aria-expanded', 'false'); + // and open this one. this.classList.add("submenu-active"); this.setAttribute('aria-expanded', 'true'); + // If hamburger if (screenWidth <= 767) { // Look at parents and hide other menus if not secondary and open @@ -78,7 +75,6 @@ } } } else { - console.log('ELSE'); this.classList.add('submenu-active'); this.setAttribute('aria-expanded', 'true'); }