From be6d0a18cd23cc6c75414ab26e0fccb721a672b7 Mon Sep 17 00:00:00 2001 From: lars Date: Sun, 15 Jun 2014 14:59:48 +0200 Subject: [PATCH] Ordering users in hub view - part 1 for #3 --- app/js/services/rpc.js | 16 +++++++++++++--- app/partials/hubs.html | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/js/services/rpc.js b/app/js/services/rpc.js index 36b83c5..0f0fc17 100644 --- a/app/js/services/rpc.js +++ b/app/js/services/rpc.js @@ -36,7 +36,7 @@ angular.module('EiskaltRPC', []).factory('EiskaltRPC', function($http) { }; return promise; } - + return { StopDaemon: function() { return jsonrpc('daemon.stop'); @@ -164,7 +164,17 @@ angular.module('EiskaltRPC', []).factory('EiskaltRPC', function($http) { return jsonrpc('hub.getusers', {huburl: huburl, separator: '#'}, true); }, GetUserInfo: function(nick, huburl) { - return jsonrpc('hub.getuserinfo', {nick: nick, huburl: huburl}); + var promise = jsonrpc('hub.getuserinfo', {nick: nick, huburl: huburl}); + promise.success = function(fn) { + promise.then(function(response) { + var info = response.data.result; + // remove space in key "Nick Order" + info['NickOrder'] = info['Nick Order']; + delete info['Nick Order']; + fn(info); + }); + }; + return promise; }, ShowLocalLists: function() { return jsonrpc('list.local', {separator: '#'}, true); @@ -223,4 +233,4 @@ angular.module('EiskaltRPC', []).factory('EiskaltRPC', function($http) { return jsonrpc('queue.getiteminfo'); } }; -}); \ No newline at end of file +}); diff --git a/app/partials/hubs.html b/app/partials/hubs.html index c1f6c4c..42ea100 100644 --- a/app/partials/hubs.html +++ b/app/partials/hubs.html @@ -13,7 +13,7 @@