Restore @rlanvin's changes that were lost during merge

Fixes #596
This commit is contained in:
JC Brand 2016-02-17 17:09:21 +00:00
parent f1b999d01a
commit 8c06f917ae
2 changed files with 5 additions and 2 deletions

View File

@ -13,7 +13,7 @@
- #573 xgettext build error: `'javascript' unknown` [jcbrand]
- #587 Fix issue when logging out with `auto_logout=true` [davec82]
- #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)

View File

@ -1739,6 +1739,7 @@
*/
chatboxviews.trimChats(this);
converse.refreshWebkit();
this.$content.scrollTop(this.model.get('scroll'));
this.setChatState(ACTIVE).focus();
converse.emit('chatBoxMaximized', this);
}.bind(this));
@ -1746,6 +1747,8 @@
minimize: function (ev) {
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(INACTIVE).model.minimize();
this.$el.hide('fast', converse.refreshwebkit);
@ -1834,7 +1837,7 @@
return this;
},
show: _.debounce(function (callback) {
show: _.debounce(function (focus) {
if (this.$el.is(':visible') && this.$el.css('opacity') === "1") {
if (focus) { this.focus(); }
return this;