Commit 4f86a7ed authored by JC Brand's avatar JC Brand

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.
parent 07985ccf
......@@ -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;
},
......
......@@ -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
---------
......
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