diff --git a/static/js/autocomlitev2.js b/static/js/autocomlitev2.js index 092a54f..9c2371a 100644 --- a/static/js/autocomlitev2.js +++ b/static/js/autocomlitev2.js @@ -1,4 +1,5 @@ function searchTown(el){ + let timer = null if (timer) { clearTimeout(timer); @@ -36,15 +37,14 @@ function searchTown(el){ -function selectItemAddrPoint(id, name, ctrl_name){ - +function selectItemAddrPoint(id, name, ctrl_name,){ + let input_list = document.getElementsByName(ctrl_name + '_list')[0]; let tap_txt_cont = document.querySelector("#id_" + ctrl_name); tap_txt_cont.value = name; let tap_cont = document.querySelector("#id_" + ctrl_name.slice(0, -4)); tap_cont.value = id; - let clear_search_list = document.querySelector(".input_list") - clear_search_list.classList.remove('show') + input_list.classList.remove('show'); } @@ -61,4 +61,17 @@ function insertSearchList(data, ctrl_name) { input_list.classList.remove("show"); } +} + +function onblurInputField(event,el){ + + // if(el.classList.contains("from_country_container")){ + let search_list = document.getElementsByName(el.name + '_list')[0]; + let parent_event = $(event.explicitOriginalTarget).parents('.input_list' ); + if(!parent_event || parent_event[0] !== search_list){ + + search_list.classList.remove('show') + } + + // } } \ No newline at end of file diff --git a/static/js/sendRoute.js b/static/js/sendRoute.js index 782a5ed..a56849f 100644 --- a/static/js/sendRoute.js +++ b/static/js/sendRoute.js @@ -38,3 +38,14 @@ function sendRoute(el){ +//cleaning route inputs after selection changes +function OnSelectionChange() { + document.getElementById("id_from_address_point_txt").value = ''; + document.getElementById("id_to_address_point_txt").value = ''; + +} + + + + + diff --git a/templates/blocks/profile/b_new_route.html b/templates/blocks/profile/b_new_route.html index f3da6a8..9c9cb42 100644 --- a/templates/blocks/profile/b_new_route.html +++ b/templates/blocks/profile/b_new_route.html @@ -9,7 +9,7 @@