From ce4ca473cbafce0fc71a2b4e69e35caa8f251595 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 16 Aug 2014 13:22:47 +0100 Subject: order the members list by most recently active --- webclient/app.js | 15 ++++++++++++++- webclient/room/room.html | 11 +++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/webclient/app.js b/webclient/app.js index 3f4c5f30f8..9cdf926425 100644 --- a/webclient/app.js +++ b/webclient/app.js @@ -114,7 +114,20 @@ matrixWebClient return d + "d " + h + "h"; } }) - .filter('to_trusted', ['$sce', function($sce){ + .filter('orderMembersList', function($sce) { + return function(members) { + var filtered = []; + angular.forEach(members, function(value, key) { + value["id"] = key; + filtered.push( value ); + }); + filtered.sort(function (a, b) { + return ((a["mtime_age"] || 10e10)> (b["mtime_age"] || 10e10) ? 1 : -1); + }); + return filtered; + }; + }) + .filter('unsafe', ['$sce', function($sce) { return function(text) { return $sce.trustAsHtml(text); }; diff --git a/webclient/room/room.html b/webclient/room/room.html index f08cb61763..5712ce9b4f 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -9,15 +9,14 @@
- + -
- + - -
+
{{ member.displayname || member.id.substr(0, member.id.indexOf(':')) }}{{ member.displayname ? "" : member.id.substr(member.id.indexOf(':')) }}
- {{ info.mtime_age | duration }} {{ info.mtime_age ? "ago" : "" }} + + {{ member.mtime_age | duration }} {{ member.mtime_age ? "ago" : "" }}
-- cgit 1.4.1