Commit ce9008a5 authored by JC Brand's avatar JC Brand

Rename onShow to onMaximized and add onMinimized

parent 7b2f75ec
...@@ -2142,7 +2142,7 @@ ...@@ -2142,7 +2142,7 @@
return this; return this;
}, },
onShow: function () { onMaximized: function () {
converse.chatboxviews.trimChats(this); converse.chatboxviews.trimChats(this);
utils.refreshWebkit(); utils.refreshWebkit();
this.$content.scrollTop(this.model.get('scroll')); this.$content.scrollTop(this.model.get('scroll'));
...@@ -2150,10 +2150,15 @@ ...@@ -2150,10 +2150,15 @@
converse.emit('chatBoxMaximized', this); converse.emit('chatBoxMaximized', this);
}, },
onMinimized: function () {
utils.refreshWebkit();
converse.emit('chatBoxMinimized', this);
},
maximize: function () { maximize: function () {
// Restore a minimized chat box // Restore a minimized chat box
$('#conversejs').prepend(this.$el); $('#conversejs').prepend(this.$el);
this.$el.show('fast', this.onShow.bind(this)); this.$el.show('fast', this.onMaximized.bind(this));
return this; return this;
}, },
...@@ -2161,10 +2166,8 @@ ...@@ -2161,10 +2166,8 @@
if (ev && ev.preventDefault) { ev.preventDefault(); } if (ev && ev.preventDefault) { ev.preventDefault(); }
// save the scroll position to restore it on maximize // save the scroll position to restore it on maximize
this.model.save({'scroll': this.$content.scrollTop()}); this.model.save({'scroll': this.$content.scrollTop()});
// Minimizes a chat box
this.setChatState(converse.INACTIVE).model.minimize(); this.setChatState(converse.INACTIVE).model.minimize();
this.$el.hide('fast', utils.refreshwebkit); this.$el.hide('fast', this.onMinimized.bind(this));
converse.emit('chatBoxMinimized', this);
}, },
updateVCard: function () { updateVCard: function () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment