diff --git a/static/js/user_profile.js b/static/js/user_profile.js index e5bd403..74d0019 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -167,16 +167,22 @@ function confirmRemove(el) { function searchTown(el){ - let from_ap = document.getElementById('id_from_address_point_txt'); - let to_ap = document.getElementById('id_to_address_point_txt'); - - if(el.value.length>0){ - from_ap.style.background = 'white url("/static/img/svg/loader.svg") no-repeat calc(100% - 15px) center'; - to_ap.style.background = 'white url("/static/img/svg/loader.svg") no-repeat calc(100% - 15px) center'; - } else{ - from_ap.style.background = 'white url("/static/img/png/icon-arrow.svg") no-repeat calc(100% - 15px) center'; - to_ap.style.background = 'white url("/static/img/png/icon-arrow.svg") no-repeat calc(100% - 15px) center'; + if (el.value.length > 0){ + el.style.background = 'white url("/static/img/svg/loader.svg") no-repeat calc(100% - 15px) center'; + }else { + el.style.background = 'white url("/static/img/png/icon-arrow.svg") no-repeat calc(100% - 15px) center'; } + // + // let from_ap = document.getElementById('id_from_address_point_txt'); + // let to_ap = document.getElementById('id_to_address_point_txt'); + // + // if(el.value.length>0){ + // from_ap.style.background = 'white url("/static/img/svg/loader.svg") no-repeat calc(100% - 15px) center'; + // to_ap.style.background = 'white url("/static/img/svg/loader.svg") no-repeat calc(100% - 15px) center'; + // } else{ + // from_ap.style.background = + // to_ap.style.background = 'white url("/static/img/png/icon-arrow.svg") no-repeat calc(100% - 15px) center'; + // } if(el.value.length>=3){ @@ -204,12 +210,7 @@ function searchTown(el){ // enctype: 'json', data: JSON.stringify(get_address_point), success: function(data){ - - from_ap.style.background = 'white url("/static/img/png/icon-arrow.svg") no-repeat calc(100% - 15px) center'; - to_ap.style.background = 'white url("/static/img/png/icon-arrow.svg") no-repeat calc(100% - 15px) center'; - - - + el.style.background = 'white url("/static/img/png/icon-arrow.svg") no-repeat calc(100% - 15px) center'; getNewMessageSession()