0.0.67 add showSearchList
This commit is contained in:
@@ -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){
|
||||
|
||||
@@ -68,12 +68,13 @@
|
||||
<input type="number" name="from_address_point" id="id_from_address_point" hidden />
|
||||
<input
|
||||
oninput="searchTown(this)"
|
||||
onclick="searchTown(this)"
|
||||
onclick="showSearchList(this)"
|
||||
onblur="setTimeout(()=>onblurInputField(event, this), 100)"
|
||||
onFocus="this.select()"
|
||||
autocomplete="off"
|
||||
type="text"
|
||||
name="from_address_point_txt"
|
||||
class="from_address_point_txt"
|
||||
{% if form.fields.from_address_point.required %} required{% endif %}
|
||||
id="id_from_address_point_txt"
|
||||
{% if form.initial.from_address_point_txt %}value="{{ form.initial.from_address_point_txt }}"{% endif %}
|
||||
@@ -93,7 +94,7 @@
|
||||
<input type="number" name="to_address_point" id="id_to_address_point" hidden />
|
||||
<input
|
||||
oninput="searchTown(this)"
|
||||
onclick="searchTown(this)"
|
||||
onclick="showSearchList(this)"
|
||||
onblur="setTimeout(()=>onblurInputField(event, this), 100)"
|
||||
onFocus="this.select()"
|
||||
autocomplete="off"
|
||||
@@ -101,6 +102,7 @@
|
||||
name="to_address_point_txt"
|
||||
{% if form.fields.to_address_point.required %} required{% endif %}
|
||||
id="id_to_address_point_txt"
|
||||
class="to_address_point_txt"
|
||||
{% if form.initial.to_address_point_txt %}value="{{ form.initial.to_address_point_txt}}"{% endif %}
|
||||
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user