From 4c6e2200c066435deb652da6d58aff35ea5af784 Mon Sep 17 00:00:00 2001 From: borissedw Date: Tue, 15 Aug 2023 16:17:52 +0300 Subject: [PATCH] 0.0.144 --- static/js/chat_sockets.js | 14 +++++++++++++- static/js/user_profile(boris).js | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/static/js/chat_sockets.js b/static/js/chat_sockets.js index 6a7d58c..9354d32 100644 --- a/static/js/chat_sockets.js +++ b/static/js/chat_sockets.js @@ -95,7 +95,17 @@ chatSocket.onmessage = function (e) { if (el_tab !== null){ document.querySelector(".tab_user_messanger.select").classList.remove("select") document.querySelector(`[data-cur-receiver-item="${old_item_tab_user}"]` ).classList.add("select") - document.querySelector(`[data-cur-receiver-item="${old_item_tab_user}"]` ).scrollIntoView(false) + document.querySelector(`[data-cur-receiver-item="${old_item_tab_user}"]` ).scrollIntoView({behavior: "smooth"}); + } + } + + } else if (data.tickets_w_manager_html) { + if (document.querySelector(".list_linked_tickets") !== null || document.querySelector(".list_unlinked_tickets") !== null) { + document.querySelector(".list_linked_tickets").innerHTML = data.tickets_w_manager_html + if (el_tab !== null){ + document.querySelector(".tab_user_messanger.select").classList.remove("select") + document.querySelector(`[data-cur-receiver-item="${old_item_tab_user}"]` ).classList.add("select") + document.querySelector(`[data-cur-receiver-item="${old_item_tab_user}"]` ).scrollIntoView({behavior: "smooth"}); } } @@ -111,6 +121,8 @@ chatSocket.onmessage = function (e) { } } + + } else if (data.type === "update_support_chat"){ if (msg_cont !== null){ if (msg_cont.dataset['curReceiver'] === ""){ diff --git a/static/js/user_profile(boris).js b/static/js/user_profile(boris).js index 3d9e13e..ab92a1d 100644 --- a/static/js/user_profile(boris).js +++ b/static/js/user_profile(boris).js @@ -187,7 +187,8 @@ function selectedUserMessenger (ticket_id=null,user_id=null){ document.querySelector(".info_profile").innerHTML = data.html; document.querySelector(".enter-message-inp").focus() - document.querySelector(".tab_user_messanger.select").scrollIntoView() + document.querySelector(".tab_user_messanger.select").scrollIntoView({behavior: "smooth"}); + }, error: function (data){