From c0f8812f9bfa035e4a56ef888a7151981bdc7fac Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Fri, 28 Jul 2017 14:51:57 -0700 Subject: [PATCH] ConversationView: when windows are closed, call unload() Anyway, unload() is a more comprehensive method for doing what the close handler was trying to do before. FREEBIE --- js/views/conversation_view.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index 42e73d2eb..55988269a 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -163,11 +163,7 @@ this.window.addEventListener('focus', this.onFocus); extension.windows.onClosed(function () { - this.window.removeEventListener('resize', onResize); - this.window.removeEventListener('focus', onFocus); - window.autosize.destroy(this.$messageField); - this.remove(); - this.model.messageCollection.reset([]); + this.unload(); }.bind(this)); this.fetchMessages(); @@ -250,6 +246,8 @@ this.window.removeEventListener('resize', this.onResize); this.window.removeEventListener('focus', this.onFocus); + window.autosize.destroy(this.$messageField); + this.view.remove(); this.remove();