kaiwa/clientapp/views/contactListItem.js

38 lines
798 B
JavaScript
Raw Normal View History

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-08-29 23:38:28 -04:00
var StrictView = require('strictview');
var templates = require('../templates');
2013-08-20 13:45:06 -04:00
module.exports = StrictView.extend({
template: templates.includes.contactListItem,
classBindings: {
show: '',
subscription: '',
chatState: ''
},
2013-08-29 23:38:28 -04:00
textBindings: {
2013-08-20 13:45:06 -04:00
displayName: '.name',
status: '.status'
},
2013-08-29 23:38:28 -04:00
srcBindings: {
avatar: '.avatar'
2013-08-20 13:45:06 -04:00
},
events: {
2013-08-23 19:07:37 -04:00
'click': 'goChat'
2013-08-20 13:45:06 -04:00
},
initialize: function (opts) {
this.render();
},
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-08-23 19:07:37 -04:00
goChat: function () {
2013-08-29 23:38:28 -04:00
console.log('event?');
2013-08-23 19:07:37 -04:00
app.navigate('chat/' + this.model.jid);
2013-08-20 13:45:06 -04:00
}
});