0.0.80
This commit is contained in:
@@ -38,12 +38,8 @@ function renderContent (el=null) {
|
|||||||
} else {
|
} else {
|
||||||
data['section_url'] = el.dataset['url']
|
data['section_url'] = el.dataset['url']
|
||||||
}
|
}
|
||||||
let language = document.querySelector(".name_language").innerHTML
|
let language = $('html').attr('lang');
|
||||||
if (language.includes("ru")){
|
data['lang'] = language
|
||||||
data['lang'] = 'ru'
|
|
||||||
} else if (language.includes("en")){
|
|
||||||
data['lang'] = 'en'
|
|
||||||
}
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||||
url: '/get_content_for_section/',
|
url: '/get_content_for_section/',
|
||||||
@@ -60,7 +56,6 @@ function renderContent (el=null) {
|
|||||||
window.scrollTo(0, 0);
|
window.scrollTo(0, 0);
|
||||||
let lang = getLang()
|
let lang = getLang()
|
||||||
replaceHrefOnOnclick()
|
replaceHrefOnOnclick()
|
||||||
|
|
||||||
if (el){
|
if (el){
|
||||||
history.pushState({
|
history.pushState({
|
||||||
'section':data['section_url']
|
'section':data['section_url']
|
||||||
@@ -137,15 +132,12 @@ function select_language (el) {
|
|||||||
select = document.querySelector(".name_language.curtain")
|
select = document.querySelector(".name_language.curtain")
|
||||||
}
|
}
|
||||||
select.innerHTML = txt
|
select.innerHTML = txt
|
||||||
let lang_f_replace = ''
|
let lang_f_replace = getLang()
|
||||||
if (window.location.href.includes('ru')){
|
lang_f_check = txt.toLowerCase()
|
||||||
lang_f_replace = 'ru'
|
// txt.toLowerCase() is selected lang:138
|
||||||
} else {
|
|
||||||
lang_f_replace = 'en'
|
|
||||||
}
|
|
||||||
window.location.href = window.location.href.replace(`${lang_f_replace}`,txt.toLowerCase())
|
window.location.href = window.location.href.replace(`${lang_f_replace}`,txt.toLowerCase())
|
||||||
history.pushState({
|
history.pushState({
|
||||||
'lang':txt
|
'lang':lang_f_replace
|
||||||
},null,window.location.href.replace(`${lang_f_replace}`,txt.toLowerCase()))
|
},null,window.location.href.replace(`${lang_f_replace}`,txt.toLowerCase()))
|
||||||
open_select_language()
|
open_select_language()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
<link rel="stylesheet" href="{% static "aerbimCSSMOBILE.css" %}">
|
<link rel="stylesheet" href="{% static "aerbimCSSMOBILE.css" %}">
|
||||||
<script src="{% static "jquery_v3_6_4.js" %}"></script>
|
<script src="{% static "jquery_v3_6_4.js" %}"></script>
|
||||||
<script src="{% static "aerbimJS.js" %}"></script>
|
<script src="{% static "aerbimJS.js" %}"></script>
|
||||||
|
<script>
|
||||||
|
lang_f_check = ''
|
||||||
|
</script>
|
||||||
<meta name="viewport" content="width=100%,maximum-scale=5,minimum-scale=1,initial-scale=1">
|
<meta name="viewport" content="width=100%,maximum-scale=5,minimum-scale=1,initial-scale=1">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
Reference in New Issue
Block a user