1.2.2 add url check for my_route dynamic_loading_routes.js

This commit is contained in:
2024-08-13 12:49:08 +03:00
parent cb84352475
commit 40a2412b9b

View File

@@ -9,6 +9,7 @@ function load_routes (el,news=null,incrase,owner_type) {
if (!news){
local_page_iterator = page_iterator
}
let check_url = (window.location.href.indexOf("my_routes") > -1)
let number_last_route = el.id
// let incrase = 2
// if (!news){
@@ -20,13 +21,20 @@ function load_routes (el,news=null,incrase,owner_type) {
}
let get_url = ""
let url_ajax = "get_articles_block/"
if (!news){
if (!news && !check_url ){
let list = forloop_func_form(data_d,"get",get_url)
data_d = list[0]
get_url = list[1]
url_ajax = "routes/find_routes/"
} else if (check_url) {
let list = forloop_func_form(data_d,"get",get_url)
data_d = list[0]
get_url = list[1]
url_ajax = "routes/get_routes/"
}
let loader = document.querySelector(".loader_f_loading_routes")
loader.classList.toggle("show")
el.classList.toggle("hide")
@@ -185,6 +193,8 @@ function load_routes (el,news=null,incrase,owner_type) {
}
insert_place.innerHTML = data.html
document.querySelector(".loader_f_loading_routes.show").classList.remove("show")
if (data.last_block === true){
el.classList.add("hide")
} else if (data.last_block === false){