Commit 6a554831 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Sort users lexicographically.

parent c9b61ab5
......@@ -767,6 +767,18 @@ function addUser(id, name) {
user.id = 'user-' + id;
user.classList.add("user-p");
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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment