Commit 8c06f917 authored by JC Brand's avatar JC Brand

Restore @rlanvin's changes that were lost during merge

Fixes #596
parent f1b999d0
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
- #573 xgettext build error: `'javascript' unknown` [jcbrand] - #573 xgettext build error: `'javascript' unknown` [jcbrand]
- #587 Fix issue when logging out with `auto_logout=true` [davec82] - #587 Fix issue when logging out with `auto_logout=true` [davec82]
- #589 Save scroll position on minimize and restore it on maximize [rlanvin] - #589 Save scroll position on minimize and restore it on maximize [rlanvin]
- #592 Add random resource for auto_login, add method generateResource to generate random resource [davec82] - #592 Add random resource for `auto_login`, add method generateResource to generate random resource [davec82]
## 0.10.1 (2016-02-06) ## 0.10.1 (2016-02-06)
......
...@@ -1739,6 +1739,7 @@ ...@@ -1739,6 +1739,7 @@
*/ */
chatboxviews.trimChats(this); chatboxviews.trimChats(this);
converse.refreshWebkit(); converse.refreshWebkit();
this.$content.scrollTop(this.model.get('scroll'));
this.setChatState(ACTIVE).focus(); this.setChatState(ACTIVE).focus();
converse.emit('chatBoxMaximized', this); converse.emit('chatBoxMaximized', this);
}.bind(this)); }.bind(this));
...@@ -1746,6 +1747,8 @@ ...@@ -1746,6 +1747,8 @@
minimize: function (ev) { minimize: function (ev) {
if (ev && ev.preventDefault) { ev.preventDefault(); } 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 // Minimizes a chat box
this.setChatState(INACTIVE).model.minimize(); this.setChatState(INACTIVE).model.minimize();
this.$el.hide('fast', converse.refreshwebkit); this.$el.hide('fast', converse.refreshwebkit);
...@@ -1834,7 +1837,7 @@ ...@@ -1834,7 +1837,7 @@
return this; return this;
}, },
show: _.debounce(function (callback) { show: _.debounce(function (focus) {
if (this.$el.is(':visible') && this.$el.css('opacity') === "1") { if (this.$el.is(':visible') && this.$el.css('opacity') === "1") {
if (focus) { this.focus(); } if (focus) { this.focus(); }
return this; return this;
......
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