From a87a06217254c2693b9a0eadfd223f1ae10ecbcf Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 25 Feb 2018 18:24:19 +0100 Subject: [PATCH] Display conversation unread messages --- .../conversations/unreadDropdown.js | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/assets/js/components/conversations/unreadDropdown.js b/assets/js/components/conversations/unreadDropdown.js index 29f156cf..8f0a66c2 100644 --- a/assets/js/components/conversations/unreadDropdown.js +++ b/assets/js/components/conversations/unreadDropdown.js @@ -188,6 +188,45 @@ ComunicWeb.components.conversations.unreadDropdown = { class: "img-circle", src: userInfos.accountImage }); + + //Add item top informations + var liTop = createElem2({ + appendTo: convLink, + type: "h4", + innerHTML: userFullName(userInfos) + }); + + //Add item top small informations + var liTopSmall = createElem2({ + appendTo: liTop, + type: "small" + }); + + //Add the message post time + var conversationLastActive = createElem2({ + appendTo: liTopSmall, + type: "span", + innerHTML: ' ' + ComunicWeb.common.date.timeDiffToStr(conversation.last_active) + " ago" + }); + + //Add conversation name (if available) + if(conversation.conv_name != ""){ + + var targetConversation = createElem2({ + appendTo: convLink, + type: "p", + innerHTML: conversation.conv_name, + }); + + } + + + //Add the message + var conversationMessage = createElem2({ + appendTo: convLink, + type: "p", + innerHTML: ""+conversation.message+"" + }) } },