From e2b205240ef1d80e4b0c55c1947c4289714a9699 Mon Sep 17 00:00:00 2001 From: ArtemB Date: Wed, 3 Jul 2024 18:24:35 +0300 Subject: [PATCH] 1.1.28 upd msg counter and news --- static/css/styles.css | 4 ++++ .../etc_operations_for_chat_socket.js | 16 +++++++++------- static/js/user_profile_2.js | 1 + 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/static/css/styles.css b/static/css/styles.css index d3ca96a..e5b7d71 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -3317,6 +3317,10 @@ details[open] summary ~ *{ .self_news_text>ol>li{ margin: 10px 0; } +.self_news_text>ol>li>ul{ + list-style: disc; + margin-left: 20px; +} .advertisement_block_news { display: none; } diff --git a/static/js/chat_socket_functions/etc_operations_for_chat_socket.js b/static/js/chat_socket_functions/etc_operations_for_chat_socket.js index 7bf6d39..aafcfc4 100644 --- a/static/js/chat_socket_functions/etc_operations_for_chat_socket.js +++ b/static/js/chat_socket_functions/etc_operations_for_chat_socket.js @@ -7,14 +7,16 @@ function update_count_unread_messages (data) { let i = 0 for (i;i < list_unrd.length;i++){ - if (!list_unrd_parent[i].classList.contains("showed")){ - // list_unrd_parent[i].classList.toggle("showed") - - // list_unrd[i].innerHTML = data.unread_msgs_count.toString() - } else { let current_count = parseInt(list_unrd[i].innerHTML); - list_unrd[i].innerHTML = (current_count + 1).toString(); - } + + if(data.unread_msgs_count){ + list_unrd[i].innerHTML = (current_count + 1).toString(); + } + + if(current_count === 0){ + list_unrd_parent[i].classList.toggle("showed") + } + } } } diff --git a/static/js/user_profile_2.js b/static/js/user_profile_2.js index 33199fd..8b21757 100644 --- a/static/js/user_profile_2.js +++ b/static/js/user_profile_2.js @@ -579,6 +579,7 @@ function selectedUserMessenger (ticket_id=null,user_id=null,el){ if (loader){ loader.classList.toggle("show") } + update_count_unread_messages() // let left_curtain = document.querySelector('.curtain.left') document.querySelector(".info_profile").innerHTML = data.html; document.querySelector(".enter-message-inp").focus()