From fee62ac61c1cecb37e283fc6f9faf0251389226f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 11 Jun 2015 17:39:08 +0200 Subject: Always keep "Everyone" and "admin" at the top of the list --- settings/js/users/groups.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'settings') diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js index 0fcca39843f..d5e37ff8d63 100644 --- a/settings/js/users/groups.js +++ b/settings/js/users/groups.js @@ -63,6 +63,20 @@ GroupList = { var lis = $userGroupList.find('.isgroup').get(); 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( $(a).find('a span').text(), $(b).find('a span').text() -- cgit v1.2.3