From e6cdcd8ed82c57eb825eec1171ceab7dce2c511d Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 2 Apr 2020 19:13:10 +0200 Subject: [PATCH] Prepare file for improvments --- assets/js/components/conversations/chatWindows.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/assets/js/components/conversations/chatWindows.js b/assets/js/components/conversations/chatWindows.js index 37b0e6d4..0a087efc 100644 --- a/assets/js/components/conversations/chatWindows.js +++ b/assets/js/components/conversations/chatWindows.js @@ -4,7 +4,7 @@ * @author Pierre HUBERT */ -ComunicWeb.components.conversations.chatWindows = { +const ConvChatWindow = { /** * @var {Object} __conversationsCache Chat windows cache @@ -850,10 +850,11 @@ ComunicWeb.components.conversations.chatWindows = { var userIsPoster = message.ID_user == userID(); //Create message element - var messageContainer = createElem2({ + const messageContainer = createElem2({ type: "div", class: "direct-chat-msg " + (userIsPoster ? "right" : "") }); + messageContainer.setAttribute("data-chatwin-msg-id", message.ID) //Display message header var messageHeader = createElem2({ @@ -1161,5 +1162,7 @@ ComunicWeb.components.conversations.chatWindows = { } } +ComunicWeb.components.conversations.chatWindows = ConvChatWindow; + //Register conversations cache cleaning function ComunicWeb.common.cacheManager.registerCacheCleaner("ComunicWeb.components.conversations.chatWindows.unloadAll"); \ No newline at end of file