Made conversation notifications lives

This commit is contained in:
Pierre 2018-02-25 18:28:58 +01:00
parent a87a062172
commit 417ddbca00
2 changed files with 18 additions and 2 deletions

View File

@ -100,4 +100,15 @@ function getMultipleUsersInfos(usersID, afterGetUserInfos, forceRequest){
*/
function log(message){
ComunicWeb.debug.logMessage(message);
}
/**
* Open a conversation specified by its ID
*
* @param {number} id The ID of the conversation to open
*/
function openConversation(id){
ComunicWeb.components.conversations.manager.addConversation({
conversationID: id
});
}

View File

@ -173,6 +173,7 @@ ComunicWeb.components.conversations.unreadDropdown = {
type: "a",
href: "#"
});
convLink.setAttribute("data-conversation-id", conversation.id);
//Add left elements
var leftElems = createElem2({
@ -220,13 +221,17 @@ ComunicWeb.components.conversations.unreadDropdown = {
}
//Add the message
var conversationMessage = createElem2({
appendTo: convLink,
type: "p",
innerHTML: "<em>"+conversation.message+"</em>"
})
});
//Make the conversation link lives
convLink.onclick = function(){
openConversation(this.getAttribute("data-conversation-id"));
}
}
},