From a37b93e96a1f78068903a3e5d9321a2909ec29bc Mon Sep 17 00:00:00 2001 From: Pierre Date: Sat, 3 Jun 2017 14:27:29 +0200 Subject: [PATCH] Friendbar show latest login of users --- assets/js/components/friends/friendsBar.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/assets/js/components/friends/friendsBar.js b/assets/js/components/friends/friendsBar.js index 524bbb14..dccf63dd 100644 --- a/assets/js/components/friends/friendsBar.js +++ b/assets/js/components/friends/friendsBar.js @@ -115,9 +115,7 @@ ComunicWeb.components.friends.bar = { nameRow.innerHTML = usersInfos["user-"+friendID].firstName + " " + usersInfos["user-"+friendID].lastName; //Add user login status - var statusRow = createElem("td", friendRow); - var iconsStats = createElem("i", statusRow); - iconsStats.className = "fa fa-fw fa-circle"; + var statusRow = createElem("td", friendRow); //Check if user is online or not var currentTime = ComunicWeb.common.date.time(); @@ -125,11 +123,14 @@ ComunicWeb.components.friends.bar = { if(timeDifference < 30){ //User is logged in + var iconsStats = createElem("i", statusRow); + iconsStats.className = "fa fa-fw fa-circle"; iconsStats.style.color = "green"; } else { //User isn't logged in - statusRow.innerHTML = ComunicWeb.common.date.diffToStr(); + var logoutTime = createElem("small", statusRow); + logoutTime.innerHTML = ComunicWeb.common.date.diffToStr(timeDifference); } }