mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 20:13:07 +00:00
Sort users
This commit is contained in:
parent
85d2ef0d39
commit
be45ab45f9
1 changed files with 16 additions and 1 deletions
|
@ -21,5 +21,20 @@ function Chan(attr) {
|
|||
}
|
||||
|
||||
Chan.prototype.sortUsers = function() {
|
||||
// ..
|
||||
this.users = _.sortBy(
|
||||
this.users,
|
||||
function(u) { return u.name.toLowerCase(); }
|
||||
);
|
||||
var modes = [
|
||||
"~",
|
||||
"%",
|
||||
"@",
|
||||
"+",
|
||||
].reverse();
|
||||
modes.forEach(function(mode) {
|
||||
this.users = _.remove(
|
||||
this.users,
|
||||
function(u) { return u.mode == mode; }
|
||||
).concat(this.users);
|
||||
}, this);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue