mirror of
https://github.com/moparisthebest/kaiwa
synced 2024-11-12 04:25:05 -05:00
41 lines
1.0 KiB
JavaScript
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);
|
|
}
|
|
});
|