Always keep "Everyone" and "admin" at the top of the list
This commit is contained in:
parent
7d8b728066
commit
fee62ac61c
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue