Browse Source

Two small changes.

- Width needs to be set on .chatroom obj as well.
- Update docs on allow_dragresize to mention that min-width and min-height
  values are honored.
JC Brand 9 years ago
parent
commit
4f86a7ed58
2 changed files with 13 additions and 8 deletions
  1. 10 5
      converse.js
  2. 3 3
      docs/source/configuration.rst

+ 10 - 5
converse.js

@@ -1251,11 +1251,7 @@
                             )
                         )
                     );
-                if (this.model.get('width')) {
-                    // If a custom width is applied (due to drag-resizing),
-                    // then we need to set the width of the .chatbox element as well.
-                    this.$el.css('width', this.model.get('width'));
-                }
+                this.setWidth();
                 this.$content = this.$el.find('.chat-content');
                 this.renderToolbar().renderAvatar();
                 this.$content.on('scroll', _.debounce(this.onScroll.bind(this), 100));
@@ -1264,6 +1260,14 @@
                 return this.showStatusMessage();
             },
 
+            setWidth: function () {
+                // If a custom width is applied (due to drag-resizing),
+                // then we need to set the width of the .chatbox element as well.
+                if (this.model.get('width')) {
+                    this.$el.css('width', this.model.get('width'));
+                }
+            },
+
             onScroll: function (ev) {
                 if ($(ev.target).scrollTop() === 0 && this.model.messages.length) {
                     this.fetchArchivedMessages({
@@ -2858,6 +2862,7 @@
                         .html(converse.templates.chatroom(this.model.toJSON()));
                 this.renderChatArea();
                 this.$content.on('scroll', _.debounce(this.onScroll.bind(this), 100));
+                this.setWidth();
                 setTimeout(converse.refreshWebkit, 50);
                 return this;
             },

+ 3 - 3
docs/source/configuration.rst

@@ -127,9 +127,9 @@ allow_dragresize
 
 * Default: ``true``
 
-Allow users to resize chats by dragging the edges. Currently only supports
-vertical resizing, horizontal resizing coming soon.
-
+Allow users to resize chats by dragging the edges. The min-height and min-width
+CSS properties set on a chat boxes (specifically on the ``#converse.js .chatbox > .box-flyout`` element)
+will be honored, IF they are set in pixels.
 
 allow_muc
 ---------