Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -203,6 +203,20 @@ function load_routes (el,news=null,incrase) {
|
||||
|
||||
}
|
||||
|
||||
function set_right_btn_owner_type (el){
|
||||
let els = document.querySelectorAll(".btns_owner")
|
||||
let i = 0
|
||||
els.forEach(function (){
|
||||
if (els[i] !== el){
|
||||
els[i].classList.remove("active")
|
||||
els[i].classList.add("deactive")
|
||||
}
|
||||
i++
|
||||
})
|
||||
el.classList.add('active')
|
||||
el.classList.remove('deactive')
|
||||
}
|
||||
|
||||
function forloop_func_form (data,get,str) {
|
||||
let list_of_elements_form = document.querySelectorAll(".el_form_find_route");
|
||||
for (let i = 0;i < list_of_elements_form.length;i++) {
|
||||
@@ -212,6 +226,7 @@ function forloop_func_form (data,get,str) {
|
||||
// }
|
||||
let name_attr = list_of_elements_form[i].attributes["name"]
|
||||
let value_el = list_of_elements_form[i].value
|
||||
let class_el = list_of_elements_form[i].classList
|
||||
if (name_attr) {
|
||||
let name_el = name_attr.value
|
||||
if (list_of_elements_form[i].tagName === "INPUT" && list_of_elements_form[i].type === "checkbox"){
|
||||
@@ -242,8 +257,18 @@ function forloop_func_form (data,get,str) {
|
||||
|
||||
} else {
|
||||
let name_el = name_attr.value
|
||||
data[name_el] = value_el
|
||||
str = `${str}${name_el}=${value_el}&`
|
||||
if (name_el === 'owner_type'){
|
||||
if (class_el.contains('active')){
|
||||
data[name_el] = value_el
|
||||
str = `${str}${name_el}=${value_el}&`
|
||||
} else {
|
||||
//
|
||||
}
|
||||
} else {
|
||||
data[name_el] = value_el
|
||||
str = `${str}${name_el}=${value_el}&`
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -451,6 +451,7 @@ function createTicket (el) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
function selectedUserMessenger (ticket_id=null,user_id=null,el){
|
||||
let loader = document.querySelector(".loader_chat_f_sw_chats")
|
||||
let block_chat = document.querySelector(".block-chat")
|
||||
|
||||
@@ -37,12 +37,12 @@
|
||||
|
||||
<div class="switch">
|
||||
<div class="form_radio_btn">
|
||||
<input class="{% if route.owner_type == 'mover' %}active {% else %} deactive{% endif %} el_form_find_route" id="radio-1" type="radio" name="owner_type" value="mover" >
|
||||
<input onclick="set_right_btn_owner_type(this)" class="btns_owner el_form_find_route" id="radio-1" type="radio" name="owner_type" value="mover" >
|
||||
<label for="radio-1">{% translate "Найти перевозчика" %}</label>
|
||||
</div>
|
||||
|
||||
<div class="form_radio_btn">
|
||||
<input class="{% if route.owner_type == 'customer' %}active {% else %} deactive{% endif %} el_form_find_route" id="radio-2" type="radio" name="owner_type" value="customer" checked>
|
||||
<input onclick="set_right_btn_owner_type(this)" class="btns_owner el_form_find_route" id="radio-2" type="radio" name="owner_type" value="customer" checked>
|
||||
<label for="radio-2">{% translate "Найти отправителя" %}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user