1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-11-18 15:25:00 -05:00
kaiwa/clientapp/views/mucListItem.js

40 lines
945 B
JavaScript
Raw Normal View History

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: '',
hasUnread: '',
joined: '',
persistent: ''
2013-09-16 19:12:00 -04:00
},
textBindings: {
displayName: '.name',
displayUnreadCount: '.unread'
2013-09-16 19:12:00 -04:00
},
events: {
2015-01-24 09:46:19 -05:00
'click': '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;
},
handleClick: function (e) {
2014-12-10 05:25:19 -05:00
app.navigate('groupchat/' + encodeURIComponent(this.model.jid));
},
handleJoinRoom: function (e) {
this.model.join();
},
handleLeaveRoom: function (e) {
this.model.leave();
2013-09-16 19:12:00 -04:00
}
});