Create the minimized_chats obj during _initialization

and don't remove during `_tearDown`.

Fixes bug in `trimChats` when logging in again and `converse.minimized_chats`
is undefined.
This commit is contained in:
JC Brand 2016-07-05 06:21:25 +00:00
parent 5ed8dfbe0a
commit 7de76924b4

View File

@ -32,22 +32,12 @@
//
// New functions which don't exist yet can also be added.
_tearDown: function () {
this._super._tearDown.apply(this, arguments);
if (this.minimized_chats) {
this.minimized_chats.undelegateEvents().model.reset();
this.minimized_chats.removeAll(); // Remove sub-views
this.minimized_chats.tearDown().remove(); // Remove overview
delete this.minimized_chats;
}
return this;
},
onConnected: function () {
_initialize: function () {
this._super._initialize.apply(this, arguments);
converse.minimized_chats = new converse.MinimizedChats({
model: converse.chatboxes
});
return this._super.onConnected.apply(this, arguments);
return this;
},
registerGlobalEventHandlers: function () {