From 8a70dc686e8659c4e20d37a079df619fea2801c4 Mon Sep 17 00:00:00 2001 From: SDE Date: Tue, 1 Aug 2023 18:43:28 +0300 Subject: [PATCH] 0.0.67 add showSearchList --- static/js/user_profile.js | 22 ++++++++++++++++++---- templates/blocks/profile/b_new_route.html | 6 ++++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/static/js/user_profile.js b/static/js/user_profile.js index df25405..b7c119d 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -157,6 +157,8 @@ function searchTown(el){ + + function selectItemAddrPoint(id, name, ctrl_name,){ let input_list = document.getElementsByName(ctrl_name + '_list')[0]; let tap_txt_cont = document.querySelector("#id_" + ctrl_name); @@ -182,12 +184,24 @@ function insertSearchList(data, ctrl_name) { } } -function showSearchList() { - let input_list = document.getElementsByClassName('input_list'); - if(input_list.classList.contains('show')){ - input_list.classList.add("show"); + + +function showSearchList(el) { + if(el.classList.contains('from_address_point_txt')){ + let input_list = document.querySelectorAll('.input_list') + let value = input_list[0].classList.contains('show') + if(value === false && input_list[0].childElementCount > 0){ + input_list[0].classList.add("show"); + } + }else if (el.classList.contains('to_address_point_txt')) { + let input_list = document.querySelectorAll('.input_list') + let value = input_list[1].classList.contains('show') + if(value === false && input_list[1].childElementCount > 0){ + input_list[1].classList.add("show"); + } } + } function onblurInputField(event,el){ diff --git a/templates/blocks/profile/b_new_route.html b/templates/blocks/profile/b_new_route.html index 1d07e55..44cf03f 100644 --- a/templates/blocks/profile/b_new_route.html +++ b/templates/blocks/profile/b_new_route.html @@ -68,12 +68,13 @@