From 54126265b2fd9a45a26a0ed524537787d0e42615 Mon Sep 17 00:00:00 2001 From: ArtemB Date: Wed, 16 Aug 2023 12:07:19 +0300 Subject: [PATCH] 0.0.97 preloader fix --- static/js/user_profile.js | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) 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()