signal-desktop/js/views/conversation_list_view.js
lilia a390e37abc Fixup change:active_at handling when setting null
When a conversation goes from active to not active, it should be removed
the view rather than promoted.

// FREEBIE
2015-09-14 16:29:03 -07:00

22 lines
607 B
JavaScript

/*
* vim: ts=4:sw=4:expandtab
*/
(function () {
'use strict';
window.Whisper = window.Whisper || {};
Whisper.ConversationListView = Whisper.ListView.extend({
tagName: 'div',
itemView: Whisper.ConversationListItemView,
onChangeActiveAt: function(conversation) {
var $el = this.$('.' + conversation.cid);
if ($el && $el.length > 0) {
if (conversation.get('active_at')) {
$el.prependTo(this.el);
} else {
$el.remove();
}
}
}
});
})();