1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-08-13 17:03:51 -04:00
kaiwa/clientapp/app/views/contactListItem.js

41 lines
1.0 KiB
JavaScript
Raw Normal View History

2013-08-20 13:45:06 -04:00
/*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: {
2013-08-23 19:07:37 -04:00
'click': 'goChat'
2013-08-20 13:45:06 -04:00
},
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;
},
2013-08-23 19:07:37 -04:00
goChat: function () {
app.navigate('chat/' + this.model.jid);
2013-08-20 13:45:06 -04:00
}
});