2013-09-16 19:12:00 -04:00
|
|
|
/*global $, app, me*/
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
var _ = require('underscore');
|
|
|
|
var HumanView = require('human-view');
|
|
|
|
var templates = require('../templates');
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = HumanView.extend({
|
|
|
|
template: templates.includes.mucListItem,
|
|
|
|
classBindings: {
|
|
|
|
activeContact: '',
|
2015-02-09 08:56:02 -05:00
|
|
|
hasUnread: '',
|
|
|
|
joined: '',
|
|
|
|
persistent: ''
|
2013-09-16 19:12:00 -04:00
|
|
|
},
|
|
|
|
textBindings: {
|
|
|
|
displayName: '.name',
|
2013-09-25 13:39:57 -04:00
|
|
|
displayUnreadCount: '.unread'
|
2013-09-16 19:12:00 -04:00
|
|
|
},
|
|
|
|
events: {
|
2015-02-09 08:56:02 -05:00
|
|
|
'click .name': 'handleClick',
|
2015-02-09 10:20:28 -05:00
|
|
|
'click .join': 'handleJoinRoom',
|
|
|
|
'click .remove': 'handleLeaveRoom'
|
2013-09-16 19:12:00 -04:00
|
|
|
},
|
|
|
|
render: function () {
|
|
|
|
this.renderAndBind({contact: this.model});
|
|
|
|
return this;
|
|
|
|
},
|
2015-02-09 08:56:02 -05:00
|
|
|
handleClick: function (e) {
|
2014-12-10 05:25:19 -05:00
|
|
|
app.navigate('groupchat/' + encodeURIComponent(this.model.jid));
|
2015-02-09 08:56:02 -05:00
|
|
|
},
|
|
|
|
handleJoinRoom: function (e) {
|
|
|
|
this.model.join();
|
|
|
|
},
|
|
|
|
handleLeaveRoom: function (e) {
|
|
|
|
this.model.leave();
|
2013-09-16 19:12:00 -04:00
|
|
|
}
|
|
|
|
});
|