0.0.97 preloader for addres_point

This commit is contained in:
2023-08-15 17:56:38 +03:00
parent 9e0b725b2f
commit 957b8c9041

View File

@@ -167,8 +167,17 @@ function confirmRemove(el) {
function searchTown(el){
document.getElementById('id_from_address_point_txt').style.background = 'white url("/static/img/svg/loader.svg") no-repeat calc(100% - 15px) center';
document.getElementById('id_to_address_point_txt').style.background = 'white url("/static/img/svg/loader.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 = '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>=3){
let timer = null
@@ -195,8 +204,11 @@ function searchTown(el){
// enctype: 'json',
data: JSON.stringify(get_address_point),
success: function(data){
document.getElementById('id_from_address_point_txt').style.background = 'white url("/static/img/png/icon-arrow.svg") no-repeat calc(100% - 15px) center';
document.getElementById('id_to_address_point_txt').style.background = 'white url("/static/img/png/icon-arrow.svg") no-repeat calc(100% - 15px) center';
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';
getNewMessageSession()