From 4888fc72115dcc3eba2ed863ba3e17a212697d91 Mon Sep 17 00:00:00 2001 From: borissedw Date: Fri, 22 Sep 2023 13:25:21 +0300 Subject: [PATCH] 0.0.255 --- static/css/styles(boris).css | 23 +++++++++++++++++++- static/js/user_profile(boris).js | 21 +++++++++++++----- templates/blocks/b_finded_routes.html | 2 +- templates/blocks/profile/b_chats.html | 2 +- templates/blocks/profile/b_support_chat.html | 2 +- 5 files changed, 41 insertions(+), 9 deletions(-) diff --git a/static/css/styles(boris).css b/static/css/styles(boris).css index 0928557..6052f99 100644 --- a/static/css/styles(boris).css +++ b/static/css/styles(boris).css @@ -316,6 +316,27 @@ } /*messenger*/ +.loader_chat_f_sw_chats.show{ + display: block; + height: 100px; + width: 100px; + position: absolute; + top: 38%; + left: 52%; +} + +.loader_chat_f_sw_chats.support.show{ + display: block; + height: 100px; + width: 100px; + position: absolute; + top: 50%; + left: 52%; +} + +.loader_chat_f_sw_chats{ + display: none; +} .container-messenger{ width: 100%; @@ -490,7 +511,7 @@ .title-list-of-users{ font-size: 18px; font-weight: 600; - padding: 20px 20px 40px 20px; + padding: 20px; display: block; } diff --git a/static/js/user_profile(boris).js b/static/js/user_profile(boris).js index af51b45..6305c68 100644 --- a/static/js/user_profile(boris).js +++ b/static/js/user_profile(boris).js @@ -183,9 +183,11 @@ async function fileListToBase64(fileList) { async function attachFilemeassge (el,id_ticket=null,sender,receiver){ // let file = el.files[0]; let fileList = el.files; - const files_for_data = await fileListToBase64(fileList) - let data = files_for_data - sendMessage(id_ticket,sender,receiver,data) + if (el.files.length > 0){ + const files_for_data = await fileListToBase64(fileList) + let data = files_for_data + sendMessage(id_ticket,sender,receiver,data) + } // let reader = new FileReader(); // let mas_for_for_each = [] @@ -253,6 +255,14 @@ function createTicket (el) { function selectedUserMessenger (ticket_id=null,user_id=null){ + let loader = document.querySelector(".loader_chat_f_sw_chats") + let block_chat = document.querySelector(".block-chat") + if (loader){ + loader.classList.toggle("show") + if (block_chat) { + block_chat.innerHTML = null + } + } let data = null let url = null if (ticket_id !== null){ @@ -279,8 +289,9 @@ function selectedUserMessenger (ticket_id=null,user_id=null){ data: JSON.stringify(data), success: function(data){ middleWareJS() - - + if (loader){ + loader.classList.toggle("show") + } document.querySelector(".info_profile").innerHTML = data.html; document.querySelector(".enter-message-inp").focus() document.querySelector(".tab_user_messanger.select").scrollIntoView({behavior: "smooth"}); diff --git a/templates/blocks/b_finded_routes.html b/templates/blocks/b_finded_routes.html index f237c2f..e921435 100644 --- a/templates/blocks/b_finded_routes.html +++ b/templates/blocks/b_finded_routes.html @@ -23,7 +23,7 @@
- {% if last_block_routes == false %} + {% if last_block_routes == False %}
diff --git a/templates/blocks/profile/b_chats.html b/templates/blocks/profile/b_chats.html index a675e72..5672044 100644 --- a/templates/blocks/profile/b_chats.html +++ b/templates/blocks/profile/b_chats.html @@ -37,7 +37,7 @@ {#
#} {#
#} {##} - +loader {% if cur_receiver %}
diff --git a/templates/blocks/profile/b_support_chat.html b/templates/blocks/profile/b_support_chat.html index 825dfe1..727edba 100644 --- a/templates/blocks/profile/b_support_chat.html +++ b/templates/blocks/profile/b_support_chat.html @@ -9,7 +9,7 @@ {#
#} {#

Техническая поддержка

#} {#
#} - + loader {% if ticket %}
{{ ticket.name }}