1/*jshint browser:true, devel:true */ 2/*global document */ 3 4var WPMLLanguageSwitcherDropdown = (function() { 5 "use strict"; 6 7 var isOpen = false; 8 9 var toggle = function(switcher) { 10 11 var subMenu; 12 13 if (switcher !== undefined) { 14 subMenu = switcher.getElementsByClassName('wpml-ls-sub-menu')[0]; 15 } 16 17 if(subMenu.style.visibility === 'visible'){ 18 subMenu.style.visibility = 'hidden'; 19 document.removeEventListener('click', close); 20 }else{ 21 subMenu.style.visibility = 'visible'; 22 document.addEventListener('click', close); 23 isOpen = true; 24 } 25 26 return false; 27 }; 28 29 var close = function(){ 30 31 if(!isOpen){ 32 var switchers = document.getElementsByClassName('js-wpml-ls-legacy-dropdown'); 33 34 for(var i=0;i<switchers.length;i++){ 35 var altLangs = switchers[i].getElementsByClassName('wpml-ls-sub-menu')[0]; 36 altLangs.style.visibility = 'hidden'; 37 } 38 } 39 40 isOpen = false; 41 }; 42 43 return { 44 'toggle': toggle 45 }; 46 47})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.