From 57780ef93ea999be78b4db1ef0a7ca9a79a84bdb Mon Sep 17 00:00:00 2001 From: SDE Date: Fri, 21 Jul 2023 15:24:35 +0300 Subject: [PATCH] 0.0.39 change algo get_address_point_ajax --- static/js/autocomlitev2.js | 28 +++++++++++-------- .../widgets/w_ac_input_address_point.html | 2 +- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/static/js/autocomlitev2.js b/static/js/autocomlitev2.js index 893bf9d..c539222 100644 --- a/static/js/autocomlitev2.js +++ b/static/js/autocomlitev2.js @@ -25,19 +25,25 @@ function searchTown(el){ }); } -function selectItemAddrPoint(id, name){ - // from_address_point - let fap_txt_cont = document.querySelector("#id_from_address_point_txt"); - let fap_cont = document.querySelector("#id_from_address_point"); - fap_txt_cont.value = name; - fap_cont.value = id; +function selectItemAddrPoint(id, name, ctrl_name){ - //to_address_point - let tap_txt_cont = document.querySelector("#id_to_address_point_txt"); - let tap_cont = document.querySelector("#id_to_address_point"); + let fap_txt_cont = document.querySelector("#id_" + ctrl_name); + let fap_cont = document.querySelector("#id_" + ctrl_name.slice(0, -4)); + fap_txt_cont.value = name; + fap_cont.value = id; - tap_txt_cont.value = name; - tap_cont.value = id; + // // from_address_point + // let fap_txt_cont = document.querySelector("#id_from_address_point_txt"); + // let fap_cont = document.querySelector("#id_from_address_point"); + // fap_txt_cont.value = name; + // fap_cont.value = id; + // + // //to_address_point + // let tap_txt_cont = document.querySelector("#id_to_address_point_txt"); + // let tap_cont = document.querySelector("#id_to_address_point"); + // + // tap_txt_cont.value = name; + // tap_cont.value = id; diff --git a/templates/widgets/w_ac_input_address_point.html b/templates/widgets/w_ac_input_address_point.html index 361b915..aabec8b 100644 --- a/templates/widgets/w_ac_input_address_point.html +++ b/templates/widgets/w_ac_input_address_point.html @@ -1,4 +1,4 @@ -
+
{{ iata_code }} - {{ name }}
{{ city__name }}, {{ city__country__name }}
\ No newline at end of file