From 9d90138847998e221c28f6c8e7ba8f6baf185d3e Mon Sep 17 00:00:00 2001 From: SBD Date: Sun, 19 Nov 2023 18:03:49 +0300 Subject: [PATCH] 0.8.376 --- static/js/user_profile_2.js | 28 ++++++++++---------- templates/blocks/profile/b_chats.html | 2 +- templates/blocks/profile/b_support_chat.html | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/static/js/user_profile_2.js b/static/js/user_profile_2.js index f251260..6a64d28 100644 --- a/static/js/user_profile_2.js +++ b/static/js/user_profile_2.js @@ -456,7 +456,12 @@ function selectedUserMessenger (ticket_id=null,user_id=null,el){ } url = 'show_chat_w_user/' } - + let user_type = getInfoAboutUser() + if (user_type === 'mobile' || user_type === 'laptop') { + closeCurtain('left') + } else if (!window.location.href.includes('profile')){ + closeCurtain() + } $.ajax({ headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, url: '/messages/' + url, @@ -474,9 +479,9 @@ function selectedUserMessenger (ticket_id=null,user_id=null,el){ } document.querySelector(".info_profile").innerHTML = data.html; document.querySelector(".enter-message-inp").focus() - let user_type = getInfoAboutUser() + document.querySelector(".tab_user_messanger.select").scrollIntoView({behavior: "smooth",block:'nearest',inline:'nearest'}); - if (document.querySelector('.support') && user_type !== 'mobile' && user_type !== 'laptop'){ + if (window.location.host.includes('support') && user_type !== 'mobile' && user_type !== 'laptop'){ let menu = document.querySelector(".menu_buttons.curtain.left") let container_user_messenger = document.querySelector(".container-messenger") if (!container_user_messenger.classList.contains('margin') || !menu.classList.contains('margin')){ @@ -488,11 +493,7 @@ function selectedUserMessenger (ticket_id=null,user_id=null,el){ 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() - } + }, error: function (data){ @@ -732,18 +733,17 @@ function open_curtain (left=null,right=null,overlay=null,close=null){ let handler_text = curtain.querySelector('.text_f_curtain') handler_text.innerHTML = curtain_name - curtain.classList.remove("open") - curtain.classList.add("close") let user_type = getInfoAboutUser() - if (user_type === 'mobile') { + if (user_type === 'mobile' || user_type === 'laptop') { curtain.classList.remove("open") curtain.classList.add("close") closeOverlay() - } else { - if (!window.location.href.includes('profile')){ + } else if (!window.location.href.includes('profile')){ // - } + } else { + curtain.classList.remove("open") + curtain.classList.add("close") } } else { diff --git a/templates/blocks/profile/b_chats.html b/templates/blocks/profile/b_chats.html index 174432b..3d9a77d 100644 --- a/templates/blocks/profile/b_chats.html +++ b/templates/blocks/profile/b_chats.html @@ -1,6 +1,6 @@ {% load static %} -