Browse Source

Fixes #1000. Scroll down when maximizing a chat room

JC Brand 7 years ago
parent
commit
e5006b0004
4 changed files with 12 additions and 10 deletions
  1. 5 0
      CHANGES.md
  2. 2 2
      dev.html
  3. 1 5
      src/converse-chatview.js
  4. 4 3
      src/converse-muc.js

+ 5 - 0
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

+ 2 - 2
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,

+ 1 - 5
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) {

+ 4 - 3
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 () {