stick with current group when the filter is used

This commit is contained in:
Arthur Schiwon 2014-04-17 21:40:28 +02:00
parent 7b8935abda
commit dea7f45782
2 changed files with 8 additions and 1 deletions

View File

@ -59,7 +59,7 @@ UserManagementFilter.prototype.init = function() {
*/
UserManagementFilter.prototype.run = function() {
this.userList.empty();
this.userList.update();
this.userList.update(GroupList.getCurrentGID());
this.groupList.empty();
this.groupList.update();
};

View File

@ -6,6 +6,8 @@
*/
var GroupList = {
activeGID: '',
addGroup: function(gid, usercount) {
var li = $('li[data-gid]').last().clone();
var ul = $('li[data-gid]').first().parent();
@ -28,6 +30,10 @@
groupLiElement.find('span[class=usercount]').first().text(usercount);
},
getCurrentGID: function() {
return GroupList.activeGID;
},
sortGroups: function(usercount) {
var lis = $('li[data-gid]').filterAttr('data-usercount', usercount.toString()).get();
var ul = $(lis).first().parent();
@ -135,6 +141,7 @@
},
showGroup: function (gid) {
GroupList.activeGID = gid;
UserList.empty();
UserList.update(gid);
$('#app-navigation li').removeClass('active');