2014-07-22 20:55:26 +02:00
|
|
|
var Whisper = Whisper || {};
|
|
|
|
|
|
|
|
(function () {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
Whisper.ConversationListView = Whisper.ListView.extend({
|
2014-07-28 00:12:59 +02:00
|
|
|
tagName: 'div',
|
2014-07-22 20:55:26 +02:00
|
|
|
id: 'contacts',
|
2014-07-23 09:24:17 +02:00
|
|
|
itemView: Whisper.ConversationListItemView,
|
2014-07-22 20:55:26 +02:00
|
|
|
collection: Whisper.Threads,
|
|
|
|
|
|
|
|
events: {
|
2014-07-23 09:06:13 +02:00
|
|
|
'click .conversation': 'select',
|
2014-07-22 20:55:26 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
select: function(e) {
|
|
|
|
var target = $(e.target).closest('.conversation');
|
2014-08-25 04:28:15 +02:00
|
|
|
if (!target.is('.selected')) {
|
|
|
|
target.siblings().removeClass('slected');
|
|
|
|
target.addClass('selected');
|
2014-07-23 10:52:23 +02:00
|
|
|
}
|
2014-07-22 20:55:26 +02:00
|
|
|
return false;
|
|
|
|
},
|
|
|
|
});
|
|
|
|
})();
|