Cable-Desktop/js/views/conversation_list_view.js
lilia 511b121a2f Refactor conversation view into two classes
One that resides in the left hand column as a list item, and another
which displays in the main column and handles ui events therein.
2014-07-27 11:35:49 -10:00

23 lines
526 B
JavaScript

var Whisper = Whisper || {};
(function () {
'use strict';
Whisper.ConversationListView = Whisper.ListView.extend({
tagName: 'ul',
id: 'contacts',
itemView: Whisper.ConversationListItemView,
collection: Whisper.Threads,
events: {
'click .conversation': 'select',
},
select: function(e) {
var target = $(e.target).closest('.conversation');
target.siblings().addClass('closed');
target.removeClass('closed').addClass('selected');
return false;
},
});
})();