From 411568fecd878fad4199dcd935df9431a2fc49f1 Mon Sep 17 00:00:00 2001 From: borissedw Date: Wed, 30 Aug 2023 12:29:26 +0300 Subject: [PATCH] 0.0.199 --- static/js/dynamic_loading_routes.js | 16 ++++++++++------ static/js/filters_functions_find_route.js | 6 +++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/static/js/dynamic_loading_routes.js b/static/js/dynamic_loading_routes.js index 3e540bb..1079ca4 100644 --- a/static/js/dynamic_loading_routes.js +++ b/static/js/dynamic_loading_routes.js @@ -92,29 +92,33 @@ function forloop_func_form (data,get,str) { if (old_val){ data["type_transport"] = `${data["type_transport"]},${value_el}` if (get !== null){ - str.replace(`type_transport=${old_val}`,`type_transport=${old_val},${value_el}/`) + // let new_old_val = old_val.replace("", ) + let new_str = str.replace(`type_transport=${old_val}`,`type_transport=${old_val},${value_el}`) + str = new_str + // str.replace(`type_transport=${new_old_val}&`,"") } } else { data[name_el] = value_el if (get !== null){ - str = `${str}${name_el}=${value_el}/` + str = `${str}${name_el}=${value_el}&` } } } - } else { - data[name_el] = "" - str = `${str}${name_el}=""/` } } else { let name_el = name_attr.value data[name_el] = value_el - str = `${str}${name_el}=${value_el}/` + str = `${str}${name_el}=${value_el}&` } } } + if (!data["type_transport"]){ + data["type_transport"] = "" + str = `${str}type_transport=""&` + } if (get !== null){ let list = [data,str] return list diff --git a/static/js/filters_functions_find_route.js b/static/js/filters_functions_find_route.js index a0faa87..72e1206 100644 --- a/static/js/filters_functions_find_route.js +++ b/static/js/filters_functions_find_route.js @@ -23,7 +23,11 @@ function filters_func_find_route_main (el){ } else { document.querySelector(".block-finded-routes").innerHTML = data.html } - // window.location.href = window.location.href + "?" + JSON.stringify(data_d) + // window.location.href = window.location.href + "?" + get_url + // window.location.search = "?" + get_url + history.pushState({'data':data_d,'str_data':get_url}, "state_filters", `?${get_url}`); + // window.history.pushState({data:get_url + // },{}) }, errors: function (data){