Friends list scrollable and automatically refreshed

This commit is contained in:
Pierre 2017-06-03 16:16:33 +02:00
parent 204a3e7e0d
commit ad7eb5a5b1
3 changed files with 19 additions and 5 deletions

View File

@ -26,7 +26,7 @@
@media screen and (min-width: 1200px) { @media screen and (min-width: 1200px) {
#friendsList { #friendsList {
width: 230px; width: 230px !important;
transition: right 1s; transition: right 1s;
right: -175px; right: -175px;
background-color: #fff3ff80; background-color: #fff3ff80;
@ -79,10 +79,9 @@
padding-top: 50px; padding-top: 50px;
position: fixed; position: fixed;
height: 100%; height: 100%;
width: 100%; width: 100% !important;
top: 0px; top: 0px;
left: 0px; left: 0px;
overflow: auto;
} }
} }

View File

@ -61,12 +61,19 @@ ComunicWeb.components.friends.bar = {
//Refresh friends list //Refresh friends list
this.refresh(listFriendsElem); this.refresh(listFriendsElem);
//Make the friend bar automaticaly refreshed (if the interval wasn't already defined)
if(!this.refreshInterval)
this.refreshInterval = setInterval(function(){
if(byId("friendsList"))
ComunicWeb.components.friends.bar.refresh(listFriendsElem);
}, 1000);
//Success //Success
return true; return true;
}, },
/** /**
* Refresh the listbar * Refresh the friendbar
* *
* @param {HTMLElement} listFriendsElem The element that contains the list of friens * @param {HTMLElement} listFriendsElem The element that contains the list of friens
* @return {Boolean} True for a success * @return {Boolean} True for a success
@ -95,6 +102,9 @@ ComunicWeb.components.friends.bar = {
//Get users ID informations //Get users ID informations
ComunicWeb.user.userInfos.getMultipleUsersInfos(usersID, function(usersInfos){ ComunicWeb.user.userInfos.getMultipleUsersInfos(usersID, function(usersInfos){
//Clean the area
listFriendsElem.innerHTML = "";
//Show each friend //Show each friend
for(i in friendsList){ for(i in friendsList){
@ -135,6 +145,11 @@ ComunicWeb.components.friends.bar = {
} }
} }
//Enable slimscroll
$(listFriendsElem.parentNode.parentNode).slimScroll({
height: '100%;'
});
}); });
}); });
}, },

View File

@ -105,7 +105,7 @@ ComunicWeb.components.searchForm = {
//Enable slimscroll //Enable slimscroll
$(menuList).slimScroll({ $(menuList).slimScroll({
height: '200px', height: '100%'
}); });
}); });
}); });