Can request message content update

This commit is contained in:
Pierre HUBERT 2021-03-06 14:52:35 +01:00
parent ba2c21bf54
commit 417b8a6600
2 changed files with 22 additions and 19 deletions

View File

@ -968,25 +968,28 @@ const ConvChatWindow = {
//Add message options //Add message options
if(userIsPoster){ if(userIsPoster){
//Update message content if (message.file == null)
var updateLi = createElem2({ {
type: "li", //Update message content
appendTo: dropdownMenu var updateLi = createElem2({
}); type: "li",
appendTo: dropdownMenu
var updateLink = createElem2({
type: "a",
appendTo: updateLi,
innerHTML: "Edit"
});
updateLink.addEventListener("click", function(){
ComunicWeb.components.conversations.messageEditor.open(message, function(newContent){
/*
DEPRECATED WITH WEBSOCKETS
*/
}); });
});
var updateLink = createElem2({
type: "a",
appendTo: updateLi,
innerHTML: "Edit"
});
updateLink.addEventListener("click", function(){
ComunicWeb.components.conversations.messageEditor.open(message, function(newContent){
/*
DEPRECATED WITH WEBSOCKETS
*/
});
});
}

View File

@ -27,7 +27,7 @@ ComunicWeb.components.conversations.messageEditor = {
//Intend to update message content //Intend to update message content
ComunicWeb.components.conversations.interface.UpdateSingleMessage( ComunicWeb.components.conversations.interface.UpdateSingleMessage(
message.ID, message.id,
content, content,
function(result){ function(result){