1
Fork 0
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:
Juliusz Chroboczek 2020-09-12 15:23:38 +02:00
parent c9b61ab532
commit 6a554831a1

View file

@ -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);
} }