From 6ba816d6a547886cfcd6cdf96a6b4a85c640f3df Mon Sep 17 00:00:00 2001 From: ebremner <ebremner@uwaterloo.ca> Date: Tue, 5 Jan 2021 15:21:20 -0500 Subject: [PATCH] ISTWCMS-4199: removing testing code --- js/component_scripts.min.js | 10 +++------- .../menu/menu--horizontal/menu--horizontal.js | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/js/component_scripts.min.js b/js/component_scripts.min.js index 76107b6c..33d5ece0 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 b974f4f9..b3465246 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'); } -- GitLab