This commit is contained in:
2023-11-11 14:14:27 +03:00
parent 7cb8a2de39
commit 5856fbb670

View File

@@ -75,10 +75,12 @@ function select_tab_profile (el,url,owner_type=null) {
function getInfoAboutUser (){
let user_type = ''
if (screen.width < 1024){
if (screen.width <= 700){
user_type = 'mobile'
} else {
} else if (screen.width > 1024) {
user_type = 'dectop'
} else if (screen.width > 700 && screen.width < 1024) {
user_type = 'laptop'
}
return user_type
}
@@ -720,31 +722,49 @@ function open_curtain (left=null,right=null,overlay=null,close=null){
handler_text.innerHTML = curtain_name
curtain.classList.remove("open")
curtain.classList.add("close")
closeOverlay()
let user_type = getInfoAboutUser()
if (user_type === 'mobile') {
curtain.classList.remove("open")
curtain.classList.add("close")
closeOverlay()
} else {
if (!window.location.href.includes('profile')){
//
}
}
} else {
curtain.classList.toggle("close")
curtain.classList.toggle("open")
let user_type = getInfoAboutUser()
if (user_type === 'mobile') {
curtain.classList.toggle("open")
curtain.classList.toggle("close")
newCurtainZIndex()
let curtain_check = getOpenCurtain()
if (curtain_check.length > 1){
let curtain_old = getCurtainWIncreaceZindex(curtain_check,'decreace')['increace']
curtain_old.classList.toggle("close")
curtain_old.classList.toggle("open")
}
if (curtain_check.length > 0){
let overlay = document.querySelector('.block_overlay.show')
if (!overlay){
let overlay_clear = document.querySelector(".block_overlay")
overlay_clear.classList.toggle('show')
overlay_clear.classList.toggle('hidden')
}
} else {
closeOverlay()
newCurtainZIndex()
let curtain_check = getOpenCurtain()
if (curtain_check.length > 1){
let curtain_old = getCurtainWIncreaceZindex(curtain_check,'decreace')['increace']
curtain_old.classList.toggle("close")
curtain_old.classList.toggle("open")
}
if (curtain_check.length > 0){
let overlay = document.querySelector('.block_overlay.show')
if (!overlay){
let overlay_clear = document.querySelector(".block_overlay")
overlay_clear.classList.toggle('show')
overlay_clear.classList.toggle('hidden')
}
} else {
closeOverlay()
if (!window.location.href.includes('profile')){
//
}
}
let handler_text = curtain.querySelector('.text_f_curtain')
if (curtain.classList.contains('open')){
handler_text.innerHTML = 'Закрыть'