Remove conversation from left pane on 'delete messages' (#1807)
This commit is contained in:
parent
abb83a895e
commit
87d8ec723a
3 changed files with 24 additions and 5 deletions
|
@ -984,8 +984,14 @@
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
var models = this.messageCollection.models;
|
var models = this.messageCollection.models;
|
||||||
this.messageCollection.reset([]);
|
this.messageCollection.reset([]);
|
||||||
_.each(models, function(message) { message.destroy(); });
|
_.each(models, function(message) {
|
||||||
this.save({lastMessage: null, timestamp: null}); // archive
|
message.destroy();
|
||||||
|
});
|
||||||
|
this.save({
|
||||||
|
lastMessage: null,
|
||||||
|
timestamp: null,
|
||||||
|
active_at: null,
|
||||||
|
});
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,12 @@
|
||||||
$el.insertBefore(target);
|
$el.insertBefore(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
removeItem: function(conversation) {
|
||||||
|
var $el = this.$('.' + conversation.cid);
|
||||||
|
if ($el && $el.length > 0) {
|
||||||
|
$el.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -108,9 +108,16 @@
|
||||||
collection : inboxCollection
|
collection : inboxCollection
|
||||||
}).render();
|
}).render();
|
||||||
|
|
||||||
this.inboxListView.listenTo(inboxCollection,
|
this.inboxListView.listenTo(
|
||||||
'add change:timestamp change:name change:number',
|
inboxCollection,
|
||||||
this.inboxListView.updateLocation);
|
'add change:timestamp change:name change:number',
|
||||||
|
this.inboxListView.updateLocation
|
||||||
|
);
|
||||||
|
this.inboxListView.listenTo(
|
||||||
|
inboxCollection,
|
||||||
|
'remove',
|
||||||
|
this.inboxListView.removeItem
|
||||||
|
);
|
||||||
|
|
||||||
this.searchView = new Whisper.ConversationSearchView({
|
this.searchView = new Whisper.ConversationSearchView({
|
||||||
el : this.$('.search-results'),
|
el : this.$('.search-results'),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue