From e4849ec6594cff6ae6cc0be65662058ab6da8b42 Mon Sep 17 00:00:00 2001 From: borissedw Date: Sun, 12 Nov 2023 15:52:39 +0300 Subject: [PATCH] 0.0.356 --- static/js/user_profile_2.js | 38 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/static/js/user_profile_2.js b/static/js/user_profile_2.js index 25c9619..8cdcc8e 100644 --- a/static/js/user_profile_2.js +++ b/static/js/user_profile_2.js @@ -482,24 +482,12 @@ function selectedUserMessenger (ticket_id=null,user_id=null){ document.querySelector(".enter-message-inp").focus() document.querySelector(".tab_user_messanger.select").scrollIntoView({behavior: "smooth",block:'nearest',inline:'nearest'}); - // let el = document.querySelector(".tab_user_messanger.select") - // let cont = document.querySelector(".insert_users") - // if (el && cont){ - // let el_pos = el.offsetTop - // cont.scrollTop = el_pos - // cont.scrollTo({ - // top: el_pos, - // behavior: "smooth" - // }); - // } - let user_type = getInfoAboutUser() - if (user_type === 'mobile') { + let curt_f_close = getCurtainWIncreaceZindex(document.querySelectorAll('.curtain')) + if (user_type === 'mobile' || user_type === 'laptop') { + closeCurtain('left') + } else if (!window.location.href.includes('profile')){ closeCurtain() - } else { - if (!window.location.href.includes('profile')){ - closeCurtain() - } } }, @@ -676,10 +664,18 @@ function show_header_list () { } } -function closeCurtain () { - let curtain = getOpenCurtain() - if (curtain){ - open_curtain(null,null,null,'close') +function closeCurtain (left,right) { + if (left){ + let left = document.querySelector(".curtain.left") + open_curtain(left,null,null,'close') + } else if (right){ + let right = document.querySelector(".curtain.right") + open_curtain(null,right,null,'close') + } else { + let curtain = getOpenCurtain() + if (curtain) { + open_curtain(null, null, null, 'close') + } } } @@ -748,7 +744,7 @@ function open_curtain (left=null,right=null,overlay=null,close=null){ } else { let user_type = getInfoAboutUser() - if (user_type === 'mobile' || !window.location.host.includes('profile')) { + if (user_type === 'mobile' || !window.location.host.includes('profile') || user_type === 'laptop' ) { curtain.classList.toggle("open") curtain.classList.toggle("close") newCurtainZIndex()