Skip to content
Snippets Groups Projects
Commit 6ba816d6 authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-4199: removing testing code

parent bcbb7a68
No related branches found
No related tags found
1 merge request!9Istwcms 4199 theme menus
...@@ -274,16 +274,12 @@ ...@@ -274,16 +274,12 @@
function toggleItem() { function toggleItem() {
console.log('CLICKED');
var parent = this.parentNode.parentNode.parentNode.parentNode; var parent = this.parentNode.parentNode.parentNode.parentNode;
var screenWidth = $(window).width(); var screenWidth = $(window).width();
if (this.classList.contains('submenu-active')) { if (this.classList.contains('submenu-active')) {
console.log('IF');
this.classList.remove('submenu-active'); this.classList.remove('submenu-active');
if (this.hasAttribute('aria-expanded', 'true')) { if (this.hasAttribute('aria-expanded', 'true')) {
...@@ -298,13 +294,14 @@ ...@@ -298,13 +294,14 @@
} }
} }
} else if ($('.submenu-active')) { } 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'); $('.submenu-active').removeClass('submenu-active').attr('aria-expanded', 'false');
// and open this one. // and open this one.
this.classList.add("submenu-active"); this.classList.add("submenu-active");
this.setAttribute('aria-expanded', 'true'); this.setAttribute('aria-expanded', 'true');
// If hamburger // If hamburger
if (screenWidth <= 767) { if (screenWidth <= 767) {
// Look at parents and hide other menus if not secondary and open // Look at parents and hide other menus if not secondary and open
...@@ -314,7 +311,6 @@ ...@@ -314,7 +311,6 @@
} }
} }
} else { } else {
console.log('ELSE');
this.classList.add('submenu-active'); this.classList.add('submenu-active');
this.setAttribute('aria-expanded', 'true'); this.setAttribute('aria-expanded', 'true');
} }
......
...@@ -38,16 +38,12 @@ ...@@ -38,16 +38,12 @@
function toggleItem() { function toggleItem() {
console.log('CLICKED');
var parent = this.parentNode.parentNode.parentNode.parentNode; var parent = this.parentNode.parentNode.parentNode.parentNode;
var screenWidth = $(window).width(); var screenWidth = $(window).width();
if (this.classList.contains('submenu-active')) { if (this.classList.contains('submenu-active')) {
console.log('IF');
this.classList.remove('submenu-active'); this.classList.remove('submenu-active');
if (this.hasAttribute('aria-expanded', 'true')) { if (this.hasAttribute('aria-expanded', 'true')) {
...@@ -62,13 +58,14 @@ ...@@ -62,13 +58,14 @@
} }
} }
} else if ($('.submenu-active')) { } 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'); $('.submenu-active').removeClass('submenu-active').attr('aria-expanded', 'false');
// and open this one. // and open this one.
this.classList.add("submenu-active"); this.classList.add("submenu-active");
this.setAttribute('aria-expanded', 'true'); this.setAttribute('aria-expanded', 'true');
// If hamburger // If hamburger
if (screenWidth <= 767) { if (screenWidth <= 767) {
// Look at parents and hide other menus if not secondary and open // Look at parents and hide other menus if not secondary and open
...@@ -78,7 +75,6 @@ ...@@ -78,7 +75,6 @@
} }
} }
} else { } else {
console.log('ELSE');
this.classList.add('submenu-active'); this.classList.add('submenu-active');
this.setAttribute('aria-expanded', 'true'); this.setAttribute('aria-expanded', 'true');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment