From e5006b0004003c653f9059fbe10df502c15ce22f Mon Sep 17 00:00:00 2001 From: JC Brand Date: Mon, 29 Jan 2018 11:40:13 +0100 Subject: [PATCH] Fixes #1000. Scroll down when maximizing a chat room --- CHANGES.md | 5 +++++ dev.html | 4 ++-- src/converse-chatview.js | 6 +----- src/converse-muc.js | 7 ++++--- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1db9becb4..2928eedca 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,8 +8,13 @@ - #993 `moment.format` is not a function error when sending a message. - #994 TypeError when using the `user.login` API. - #995 `ChildNode.replaceWith` is not available in Internet Explorer or Safari. Use `Node.replaceChild` instead. +- #1000 Scroll to bottom when maximizing a chat room. - #1003 Don't list MUC domain in rooms list. +### Translation changes + +- Updated Dutch, French, Japanese, Norwegian Bokmål and Ukrainian translations + ## 3.3.1 (2018-01-18) ### UI/UX changes diff --git a/dev.html b/dev.html index a3611ee93..63fc5f330 100644 --- a/dev.html +++ b/dev.html @@ -65,8 +65,8 @@ 'discuss@conference.conversejs.org' ], auto_reconnect: true, - bosh_service_url: 'http://chat.example.org:5280/http-bind/', - // bosh_service_url: 'https://conversejs.org/http-bind/', // Please use this connection manager only for testing purposes + // bosh_service_url: 'http://chat.example.org:5280/http-bind/', + bosh_service_url: 'https://conversejs.org/http-bind/', // Please use this connection manager only for testing purposes message_archiving: 'always', show_controlbox_by_default: true, strict_plugin_dependencies: false, diff --git a/src/converse-chatview.js b/src/converse-chatview.js index ba25951da..b14a28d64 100644 --- a/src/converse-chatview.js +++ b/src/converse-chatview.js @@ -992,11 +992,7 @@ if (focus) { this.focus(); } return; } - const that = this; - u.fadeIn(this.el, function () { - that.afterShown(); - if (focus) { that.focus(); } - }); + u.fadeIn(this.el, _.bind(this.afterShown, this, focus)); }, show (focus) { diff --git a/src/converse-muc.js b/src/converse-muc.js index 56ac373d3..65365a185 100644 --- a/src/converse-muc.js +++ b/src/converse-muc.js @@ -553,7 +553,7 @@ })); }, - afterShown () { + afterShown (focus) { /* Override from converse-chatview, specifically to avoid * the 'active' chat state from being sent out prematurely. * @@ -565,6 +565,8 @@ this.model.save(); } this.occupantsview.setOccupantsHeight(); + this.scrollDown(); + if (focus) { this.focus(); } }, show (focus) { @@ -575,8 +577,7 @@ // Override from converse-chatview in order to not use // "fadeIn", which causes flashing. u.showElement(this.el); - this.afterShown(); - if (focus) { this.focus(); } + this.afterShown(focus); }, afterConnected () {