summaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-07-05 01:21:18 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-07-09 14:30:39 +0200
commita584022ecc7f186386a748122a84e21615e29399 (patch)
tree5f023ec65a41f9f0c0d2d5e4731a6934a64ac820 /settings/js
parent404ac8bcd32aca8f9b004621ac737800cd86dfd1 (diff)
downloadnextcloud-server-a584022ecc7f186386a748122a84e21615e29399.tar.gz
nextcloud-server-a584022ecc7f186386a748122a84e21615e29399.zip
increment group counters when a user is created
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/users/groups.js4
-rw-r--r--settings/js/users/users.js10
2 files changed, 12 insertions, 2 deletions
diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js
index dcaf593b886..c3e3d1a50c9 100644
--- a/settings/js/users/groups.js
+++ b/settings/js/users/groups.js
@@ -34,6 +34,10 @@ GroupList = {
$groupLiElement.find('.usercount').text(usercount);
},
+ getUserCount: function ($groupLiElement) {
+ return parseInt($groupLiElement.data('usercount'), 10);
+ },
+
getCurrentGID: function () {
return GroupList.activeGID;
},
diff --git a/settings/js/users/users.js b/settings/js/users/users.js
index f84d67b75bc..170a4bd89da 100644
--- a/settings/js/users/users.js
+++ b/settings/js/users/users.js
@@ -91,8 +91,8 @@ var UserList = {
}
$tdLastLogin = $tr.find('td.lastLogin');
$tdLastLogin.text(lastLoginRel);
- //tooltip makes it complicated … to not insert new HTML, we adjust the
- //original title. We use a temporary div to get back the html that we
+ //tooltip makes it complicated … to not insert new HTML, we adjust the
+ //original title. We use a temporary div to get back the html that we
//can pass later. It is also required to initialise tipsy.
var tooltip = $('<div>').html($($tdLastLogin.attr('original-title')).text(lastLoginAbs)).html();
$tdLastLogin.tipsy({gravity:'s', fade:true, html:true});
@@ -602,6 +602,12 @@ $(document).ready(function () {
if (result.data.groups) {
var addedGroups = result.data.groups;
UserList.availableGroups = $.unique($.merge(UserList.availableGroups, addedGroups));
+ for (i in result.data.groups) {
+ var gid = result.data.groups[i];
+ $li = GroupList.getGroupLI(gid);
+ userCount = GroupList.getUserCount($li);
+ GroupList.setUserCount($li, userCount + 1);
+ }
}
if (result.data.homeExists){
OC.Notification.hide();