mirror of https://github.com/calzoneman/sync.git
Sorted userlist
This commit is contained in:
parent
671b6398ab
commit
066c0e9d2e
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue