1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-11-12 04:25:05 -05:00
kaiwa/clientapp/app/views/contactListItem.js
2013-08-23 16:07:37 -07:00

41 lines
1.0 KiB
JavaScript

/*global app, $*/
var StrictView = require('strictview');
var templates = require('templates');
var _ = require('underscore');
var ContactListItemResource = require('views/contactListItemResource');
module.exports = StrictView.extend({
template: templates.includes.contactListItem,
classBindings: {
show: '',
subscription: '',
chatState: ''
},
contentBindings: {
displayName: '.name',
status: '.status'
},
imageBindings: {
avatar: '.avatar img'
},
events: {
'click': 'goChat'
},
initialize: function (opts) {
this.containerEl = opts.containerEl;
this.render();
},
render: function () {
this.subViewRender({context: {contact: this.model}});
//this.collectomatic(this.model.resources, ContactListItemResource, {
// containerEl: this.$('.resources')
//});
this.handleBindings();
return this;
},
goChat: function () {
app.navigate('chat/' + this.model.jid);
}
});