Sorted userlist

This commit is contained in:
calzoneman 2013-03-17 20:37:43 -05:00
parent 671b6398ab
commit 066c0e9d2e
1 changed files with 8 additions and 0 deletions

View File

@ -18,6 +18,14 @@ function addUser(name, rank, leader) {
fmtUserlistItem(div, rank, leader); fmtUserlistItem(div, rank, leader);
if(RANK >= Rank.Moderator) if(RANK >= Rank.Moderator)
addUserDropdown(div, name); addUserDropdown(div, name);
var users = $('#userlist').children();
for(var i = 0; i < users.length; i++) {
var othername = users[i].children[1].innerHTML;
if(othername > name) {
$(div).insertBefore(users[i]);
return;
}
}
$('#userlist')[0].appendChild(div); $('#userlist')[0].appendChild(div);
} }