/*jshint browser:true, devel:true */ /*global document */ var WCMLCurrecnySwitcherDropdownClick = (function() { "use strict"; var wrapperSelector = '.js-wcml-dropdown-click'; var submenuSelector = '.js-wcml-dropdown-click-submenu'; var isOpen = false; var toggle = function(event) { var subMenu = this.querySelectorAll(submenuSelector)[0]; if(subMenu.style.visibility === 'visible'){ subMenu.style.visibility = 'hidden'; document.removeEventListener('click', close); }else{ subMenu.style.visibility = 'visible'; document.addEventListener('click', close); isOpen = true; } return false; }; var close = function(){ if(!isOpen){ var switchers = document.querySelectorAll(wrapperSelector); for(var i=0;i