1if (document.getElementsByClassName('country-picker-popup')[0]) { 2 var country_picker_popup = document.getElementsByClassName('country-picker-popup')[0]; 3 function header_country_picker() { 4 var header_right_sections = document.getElementById('mainHeader').getElementsByClassName('actions'); 5 for (j=0; j < header_right_sections.length; j++) { 6 var header_country_picker = document.createElement('div'); 7 header_country_picker.classList = 'country-picker'; 8 header_country_picker.innerHTML = country_picker_popup.getElementsByClassName('current')[0].innerHTML; 9 header_right_sections[j].insertBefore(header_country_picker, header_right_sections[j].getElementsByClassName('icon-cart')[0]); 10 header_country_picker.onclick = function() { 11 var header_country_picker = document.getElementById('mainHeader').getElementsByClassName('country-picker'); 12 for (k=0; k < header_country_picker.length; k++) { 13 header_country_picker[k].remove(); 14 k--; 15 } 16 country_picker_popup.classList.add('show'); 17 } 18 } 19 } 20 var countries = country_picker_popup.getElementsByClassName('countries')[0].getElementsByClassName('country'); 21 for (i=0; i < countries.length; i++) { 22 countries[i].onclick = function() { 23 if (this.classList.contains('current')) { 24 country_picker_popup.classList.remove('show'); 25 if (!document.getElementById('mainHeader').getElementsByClassName('country-picker')[0]) { 26 header_country_picker(); 27 } 28 } 29 else { 30 window.location.href = this.getAttribute('destination-url'); 31 } 32 } 33 } 34 if (document.cookie.indexOf('country-picker-popup') != -1) { 35 header_country_picker(); 36 } 37 country_picker_popup.onclick = function(e) { 38 if (e.target.classList.contains('country-picker-popup')) { 39 this.getElementsByClassName('current')[0].click(); 40 } 41 } 42}
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.