1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2025-02-16 15:10:11 -05:00

Track idleSince time for contacts

This commit is contained in:
Lance Stout 2013-09-26 21:29:45 -07:00
parent 37e4fa3502
commit 50c6f7b317
6 changed files with 38 additions and 21455 deletions

File diff suppressed because one or more lines are too long

View File

@ -109,6 +109,12 @@ module.exports = HumanModel.define({
return resource.idleSince || undefined;
}
},
idle: {
deps: ['idleSince'],
fn: function () {
return !!this.idleSince;
}
},
chatState: {
deps: ['topResource', 'lockedResource', '_forceUpdate'],
fn: function () {

View File

@ -15,7 +15,14 @@ module.exports = BaseCollection.extend({
return 1;
}
if (res1.show === res2.show) {
return 0;
if (!!res1.idleSince && !!res2.idleSince) {
return 0;
}
if (res1.idleSince && !res2.idleSince) {
return 1;
}
return -1;
}
var ranking = {

View File

@ -13,7 +13,8 @@ module.exports = HumanView.extend({
subscription: '',
chatState: '',
activeContact: '',
hasUnread: ''
hasUnread: '',
idle: ''
},
textBindings: {
displayName: '.name',

View File

@ -122,6 +122,12 @@
&:after
background: $textSecondary
&.idle
.name
color: red
&:after
background: red
img
opacity: 1

View File

@ -469,6 +469,14 @@ h3 {
#bookmarks li.paused:after {
background: #b7b7b7;
}
#roster li.idle .name,
#bookmarks li.idle .name {
color: #f00;
}
#roster li.idle:after,
#bookmarks li.idle:after {
background: #f00;
}
#roster li img,
#bookmarks li img {
opacity: 1;