0.0.151
This commit is contained in:
30
static/js/chat_socket_functions/update_messenger.js
Normal file
30
static/js/chat_socket_functions/update_messenger.js
Normal file
@@ -0,0 +1,30 @@
|
||||
function update_chat_html (data,msg_cont) {
|
||||
if (data.chat_html){
|
||||
if (msg_cont !== null){
|
||||
if (msg_cont.dataset['curReceiver'] === ""){
|
||||
document.querySelector(".fotter-chat")
|
||||
msg_cont.innerHTML = data.chat_html
|
||||
} else {
|
||||
// что бы не выводился левый чат
|
||||
if (msg_cont.dataset['curReceiver'] === data['sender'].toString() || msg_cont.dataset['curReceiver'] === data['receiver'].toString()) {
|
||||
msg_cont.innerHTML = data.chat_html
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function update_list_w_users (data,old_item_tab_user) {
|
||||
let list_of_users = document.querySelector(".block-list-of-users")
|
||||
if (list_of_users) {
|
||||
|
||||
if (data.users_list_html){
|
||||
list_of_users.innerHTML = data.users_list_html
|
||||
if (el_tab !== null){
|
||||
document.querySelector(`[data-cur-receiver-item="${old_item_tab_user}"]` ).classList.add("select")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user