1BX.ready(() => { 2 setPopupObservers(); 3}); 4 5function onCompleteAction() { 6 setTimeout(() => {setPopupObservers();}, 1000); 7} 8 9function setPopupObservers() { 10 let popupFormWrapper = document.getElementById('popup_iframe_wrapper'); 11 console.log(popupFormWrapper); 12 if(!popupFormWrapper) 13 return; 14 15 console.log('setwrappers'); 16 let popupWrapperObserver = new MutationObserver(onPopupWrapperContentChanged); 17 popupWrapperObserver.observe(popupFormWrapper, { 18 childList: true, 19 }); 20} 21 22 23function onPopupWrapperContentChanged(mutationRecords) { 24 let forms = document.querySelectorAll('#popup_iframe_wrapper .jqmWindow'); 25 26 forms.forEach((form) => { 27 28 let citySelector = form.querySelector('[name="CITY"]'); 29 if(!citySelector) 30 return; 31 32 let city = getCurrentCity(); 33 34 let options = citySelector.querySelectorAll('option'); 35 36 options.forEach((option) => { 37 if(option.innerHTML === city) { 38 citySelector.value = option.value; 39 option.selected = 'selected'; 40 } 41 }); 42 43 44 }); 45} 46 47function getCurrentCity() { 48 let city = document.querySelector('.region_wrapper .js_city_chooser > span:first-of-type')?.innerHTML; 49 return city; 50} 51
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.