From ce9008a56a23d5420673b82864f3c46550e8240a Mon Sep 17 00:00:00 2001 From: JC Brand Date: Wed, 9 Mar 2016 09:59:25 +0000 Subject: [PATCH] Rename onShow to onMaximized and add onMinimized --- src/converse-core.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/converse-core.js b/src/converse-core.js index b34b51ad1..7f75c171a 100755 --- a/src/converse-core.js +++ b/src/converse-core.js @@ -2142,7 +2142,7 @@ return this; }, - onShow: function () { + onMaximized: function () { converse.chatboxviews.trimChats(this); utils.refreshWebkit(); this.$content.scrollTop(this.model.get('scroll')); @@ -2150,10 +2150,15 @@ converse.emit('chatBoxMaximized', this); }, + onMinimized: function () { + utils.refreshWebkit(); + converse.emit('chatBoxMinimized', this); + }, + maximize: function () { // Restore a minimized chat box $('#conversejs').prepend(this.$el); - this.$el.show('fast', this.onShow.bind(this)); + this.$el.show('fast', this.onMaximized.bind(this)); return this; }, @@ -2161,10 +2166,8 @@ if (ev && ev.preventDefault) { ev.preventDefault(); } // save the scroll position to restore it on maximize this.model.save({'scroll': this.$content.scrollTop()}); - // Minimizes a chat box this.setChatState(converse.INACTIVE).model.minimize(); - this.$el.hide('fast', utils.refreshwebkit); - converse.emit('chatBoxMinimized', this); + this.$el.hide('fast', this.onMinimized.bind(this)); }, updateVCard: function () {