mobile === false

This commit is contained in:
SBD
2023-12-29 12:49:13 +05:00
parent 1dae86f0e7
commit f80e2844bf
2 changed files with 50 additions and 22 deletions

View File

@@ -17,31 +17,52 @@ function middleWareJS(){
let footer = document.querySelector("footer")
let body = document.querySelector("body")
let type = getInfoAboutUser()
if (type !== 'mobile'){
if (document.querySelector(".menu_buttons.curtain.left") || window.location.href.includes('support') || window.location.href.includes('chat')){
footer.style.display = "none"
body.style.overflow = "hidden"
// if (type !== 'mobile'){
if (document.querySelector(".menu_buttons.curtain.left") || window.location.href.includes('support') || window.location.href.includes('chat')){
footer.style.display = "none"
body.style.overflow = "hidden"
} else {
footer.style.display = ""
body.style.overflow = ""
}
} else {
footer.style.display = ""
body.style.overflow = ""
}
// }/
}
function changeTopStrMobile (){
let body = document.querySelector("body")
if (!window.location.href.includes("mobile")){
if (!window.location.href.includes("mobile") && !window.location.href.includes("route_search_results")){
window.location.href = window.location.href + `?mobile=${getInfoAboutUser() === 'mobile'}`
}
// if (!window.location.href.includes("mobile")){
// if (!window.location.href.includes("mobile") && !window.location.href.includes("route_search_results")){
// window.location.href = window.location.href + `?mobile=${getInfoAboutUser() === 'mobile'}`
// }
body.style.opacity = ''
body.style.transition = '500ms'
} else {
// } else {
body.style.display = ''
body.style.transition = '500ms'
// }
}
function openOrCloseCurtainSupportChat (){
if (window.location.href.includes("support")){
let type_screen = getInfoAboutUser()
let chat_block = document.querySelector(".block-chat")
let name_ticket = document.querySelector(".name_ticket")
let str = 'menu_buttons curtain left'
if (type_screen === 'mobile'){
if (!chat_block){
str = `${str} open`
} else {
str = `${str} close`
}
} else {
str = `${str} open`
}
if (name_ticket){
str = `${str} margin`
}
document.querySelector(".menu_buttons").class = str
}
}