2013-08-29 23:38:28 -04:00
|
|
|
/*global $, app, me*/
|
|
|
|
"use strict";
|
|
|
|
|
2013-08-20 13:45:06 -04:00
|
|
|
var _ = require('underscore');
|
2013-09-03 22:18:31 -04:00
|
|
|
var HumanView = require('human-view');
|
2013-08-29 23:38:28 -04:00
|
|
|
var templates = require('../templates');
|
2013-08-20 13:45:06 -04:00
|
|
|
|
|
|
|
|
2013-09-03 22:18:31 -04:00
|
|
|
module.exports = HumanView.extend({
|
2013-08-20 13:45:06 -04:00
|
|
|
template: templates.includes.contactListItem,
|
|
|
|
classBindings: {
|
|
|
|
show: '',
|
|
|
|
subscription: '',
|
2013-09-11 23:59:50 -04:00
|
|
|
chatState: '',
|
|
|
|
activeContact: '',
|
2013-09-27 00:29:45 -04:00
|
|
|
hasUnread: '',
|
2015-02-09 08:56:02 -05:00
|
|
|
idle: '',
|
|
|
|
persistent: ''
|
2013-08-20 13:45:06 -04:00
|
|
|
},
|
2013-08-29 23:38:28 -04:00
|
|
|
textBindings: {
|
2013-08-20 13:45:06 -04:00
|
|
|
displayName: '.name',
|
2013-09-11 23:59:50 -04:00
|
|
|
status: '.status',
|
2013-09-25 04:47:11 -04:00
|
|
|
displayUnreadCount: '.unread'
|
2013-08-20 13:45:06 -04:00
|
|
|
},
|
2013-08-29 23:38:28 -04:00
|
|
|
srcBindings: {
|
|
|
|
avatar: '.avatar'
|
2013-08-20 13:45:06 -04:00
|
|
|
},
|
|
|
|
events: {
|
2013-09-16 05:19:07 -04:00
|
|
|
'click': 'handleClick'
|
2013-08-20 13:45:06 -04:00
|
|
|
},
|
|
|
|
render: function () {
|
2013-08-29 23:38:28 -04:00
|
|
|
this.renderAndBind({contact: this.model});
|
2013-08-20 13:45:06 -04:00
|
|
|
return this;
|
|
|
|
},
|
2013-09-16 05:19:07 -04:00
|
|
|
handleClick: function () {
|
2013-08-23 19:07:37 -04:00
|
|
|
app.navigate('chat/' + this.model.jid);
|
2013-08-20 13:45:06 -04:00
|
|
|
}
|
|
|
|
});
|