Created friends list modal script file

This commit is contained in:
Pierre 2018-03-05 18:50:56 +01:00
parent 4fcadb0355
commit 3dfd91102f
4 changed files with 34 additions and 1 deletions

View File

@ -548,6 +548,13 @@ var ComunicWeb = {
bar:{
//TODO : implement
},
/**
* Friends list modal box
*/
listModal: {
//TODO : implement
}
},
/**

View File

@ -0,0 +1,18 @@
/**
* Friends list modal
*
* @author Pierre HUBERT
*/
ComunicWeb.components.friends.listModal = {
/**
* Display the box that contains the list of friends of the user
*
* @param {number} userID The ID of the target user
*/
display: function(userID){
alert(userID);
}
};

View File

@ -108,13 +108,20 @@ ComunicWeb.pages.userPage.profileInfos = {
type: "b",
innerHTML: "Friends"
});
createElem2({
var friendsListLink = createElem2({
appendTo: friendsLi,
type: "a",
class: "pull-right",
innerHTML: infos.number_friends
});
//Make the user number lives
friendsListLink.onclick = function(){
ComunicWeb.components.friends.listModal.display(infos.userID);
};
//Add user status informations (if required)
if(signed_in()){
if(userID() != infos.userID){

View File

@ -213,6 +213,7 @@ class Dev {
//Friends components
"js/components/friends/friendsList.js",
"js/components/friends/friendsBar.js",
"js/components/friends/listModal.js",
//Private conversations
"js/components/conversations/manager.js",