summaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-07-09 16:48:26 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-07-09 16:48:26 +0200
commit56f029d52428ca2b8b4c3ef86051423fc311d6a8 (patch)
treea7eaff26d70cde235363cea9b40f44e376a4e60d /settings/js
parent899d6eab0056bd5179915cc29bb8ff873240eaa2 (diff)
downloadnextcloud-server-56f029d52428ca2b8b4c3ef86051423fc311d6a8.tar.gz
nextcloud-server-56f029d52428ca2b8b4c3ef86051423fc311d6a8.zip
use .filterAttr()
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/users/users.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js
index 1fcd68bad59..97f3a960a6e 100644
--- a/settings/js/users/users.js
+++ b/settings/js/users/users.js
@@ -385,20 +385,21 @@ var UserList = {
function (response) {
if (response.status === 'success') {
GroupList.update();
- if (UserList.availableGroups.indexOf(response.data.groupname) === -1 &&
+ var groupName = response.data.groupname;
+ if (UserList.availableGroups.indexOf(groupName) === -1 &&
response.data.action === 'add'
) {
- UserList.availableGroups.push(response.data.groupname);
+ UserList.availableGroups.push(groupName);
}
// in case this was the last user in that group the group has to be removed
- var groupElement = GroupList.getGroupLI(response.data.groupname);
+ var groupElement = GroupList.getGroupLI(groupName);
var userCount = GroupList.getUserCount(groupElement);
if (response.data.action === 'remove' && userCount === 1) {
- _.without(UserList.availableGroups, response.data.groupname);
- GroupList.remove(response.data.groupname);
- $('.groupsselect option[value='+response.data.groupname+']').remove();
- $('.subadminsselect option[value='+response.data.groupname+']').remove();
+ _.without(UserList.availableGroups, groupName);
+ GroupList.remove(groupName);
+ $('.groupsselect option').filterAttr('value', groupName).remove();
+ $('.subadminsselect option').filterAttr('value', groupName).remove();
}