Always keep "Everyone" and "admin" at the top of the list

This commit is contained in:
Joas Schilling 2015-06-11 17:39:08 +02:00
parent 7d8b728066
commit fee62ac61c
1 changed files with 14 additions and 0 deletions

View File

@ -63,6 +63,20 @@ GroupList = {
var lis = $userGroupList.find('.isgroup').get(); var lis = $userGroupList.find('.isgroup').get();
lis.sort(function (a, b) { lis.sort(function (a, b) {
// "Everyone" always at the top
if ($(a).data('gid') === '_everyone') {
return -1;
} else if ($(b).data('gid') === '_everyone') {
return 1;
}
// "admin" always as second
if ($(a).data('gid') === 'admin') {
return -1;
} else if ($(b).data('gid') === 'admin') {
return 1;
}
return UserList.alphanum( return UserList.alphanum(
$(a).find('a span').text(), $(a).find('a span').text(),
$(b).find('a span').text() $(b).find('a span').text()