summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-10-02 08:55:53 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-10-02 08:55:53 +0200
commit3ce45863ab646b312ad04b25fa9670bedb08497b (patch)
treec010ea1d4f85f56d9ae2cf87dd7644a6e4473579 /settings
parent3b4592718a40100d794a638559ead647dd5d1e2e (diff)
downloadnextcloud-server-3ce45863ab646b312ad04b25fa9670bedb08497b.tar.gz
nextcloud-server-3ce45863ab646b312ad04b25fa9670bedb08497b.zip
Modify the group user count when changing membership of a user
Diffstat (limited to 'settings')
-rw-r--r--settings/js/users/groups.js16
-rw-r--r--settings/js/users/users.js5
2 files changed, 17 insertions, 4 deletions
diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js
index 322db6c1b45..c8d2ef7c5b1 100644
--- a/settings/js/users/groups.js
+++ b/settings/js/users/groups.js
@@ -49,18 +49,26 @@ GroupList = {
return parseInt($groupLiElement.data('usercount'), 10);
},
- modEveryoneCount: function(diff) {
- var $li = GroupList.getGroupLI(GroupList.everyoneGID);
+ modGroupCount: function(gid, diff) {
+ var $li = GroupList.getGroupLI(gid);
var count = GroupList.getUserCount($li) + diff;
GroupList.setUserCount($li, count);
},
incEveryoneCount: function() {
- GroupList.modEveryoneCount(1);
+ GroupList.modGroupCount(GroupList.everyoneGID, 1);
},
decEveryoneCount: function() {
- GroupList.modEveryoneCount(-1);
+ GroupList.modGroupCount(GroupList.everyoneGID, -1);
+ },
+
+ incGroupCount: function(gid) {
+ GroupList.modGroupCount(gid, 1);
+ },
+
+ decGroupCount: function(gid) {
+ GroupList.modGroupCount(gid, -1);
},
getCurrentGID: function () {
diff --git a/settings/js/users/users.js b/settings/js/users/users.js
index 47d63c11b95..519fe9655db 100644
--- a/settings/js/users/users.js
+++ b/settings/js/users/users.js
@@ -470,6 +470,11 @@ var UserList = {
UserList.availableGroups.push(groupName);
}
+ if (response.data.action === 'add') {
+ GroupList.incGroupCount(groupName);
+ } else {
+ GroupList.decGroupCount(groupName);
+ }
}
if (response.data.message) {
OC.Notification.show(response.data.message);