Created conversation settings pane

This commit is contained in:
Pierre
2017-06-17 11:20:54 +02:00
parent 6e89fe632c
commit dea79bdce1
4 changed files with 79 additions and 1 deletions

View File

@ -155,6 +155,49 @@ ComunicWeb.components.conversations.chatWindows = {
//Success
return true;
}
},
/**
* Show conversation settings (button + pane)
*
* @param {Object} infos Informations about the conversation
* @return {Boolean} True for a success
*/
showConversationSettings: function(infos){
console.log(infos);
//Create and display conversation settings button wheel
infos.box.settingsButton = createElem2({
type: "button",
insertBefore: infos.box.membersButton,
class: "btn btn-box-tool",
type: "button"
});
//Add button icon
createElem2({
type: "i",
appendTo: infos.box.settingsButton,
class: "fa fa-gear",
});
//Create settings pane
var settingsPane = createElem2({
type: "div",
appendTo: infos.box.boxBody,
class: "conversation-settings-pane",
innerHTML: "<p>Welcome to settings world</p>",
});
//Make the settings button lives
infos.box.settingsButton.onclick = function(){
if(settingsPane.className.includes(" open"))
settingsPane.className = settingsPane.className.replace(" open", ""); //Close the pane
else
settingsPane.className += " open"; //Open the pane
};
//Success
return true;
},
}

View File

@ -184,6 +184,10 @@ ComunicWeb.components.conversations.manager = {
//Update conversation members informations
ComunicWeb.components.conversations.chatWindows.updateMembersList(conversationInfos);
//Display conversation settings pane
ComunicWeb.components.conversations.chatWindows.showConversationSettings(conversationInfos);
});
});