mirror of
https://github.com/jech/galene.git
synced 2024-11-22 16:45:58 +01:00
Sort users lexicographically.
This commit is contained in:
parent
c9b61ab532
commit
6a554831a1
1 changed files with 12 additions and 0 deletions
|
@ -767,6 +767,18 @@ function addUser(id, name) {
|
||||||
user.id = 'user-' + id;
|
user.id = 'user-' + id;
|
||||||
user.classList.add("user-p");
|
user.classList.add("user-p");
|
||||||
user.textContent = name ? name : '(anon)';
|
user.textContent = name ? name : '(anon)';
|
||||||
|
|
||||||
|
if(name) {
|
||||||
|
let us = div.children;
|
||||||
|
for(let i = 0; i < us.length; i++) {
|
||||||
|
let child = us[i];
|
||||||
|
let childname = users[child.id.slice('user-'.length)];
|
||||||
|
if(!childname || childname > name) {
|
||||||
|
div.insertBefore(user, child);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
div.appendChild(user);
|
div.appendChild(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue