Maintain bottom-most scroll position when resizing conversation area.
Closes #278
This commit is contained in:
parent
1a82a12a30
commit
476eb54db1
1 changed files with 10 additions and 1 deletions
|
@ -217,12 +217,21 @@
|
|||
}
|
||||
|
||||
var $discussionContainer = this.$('.discussion-container'),
|
||||
$bottomBar = this.$('.bottom-bar');
|
||||
$bottomBar = this.$('.bottom-bar'),
|
||||
$messageList = this.$('.message-list');
|
||||
|
||||
var scrollPosition = $messageList.scrollTop() + $messageList.outerHeight(),
|
||||
scrollHeight = $messageList[0].scrollHeight,
|
||||
shouldStickToBottom = scrollPosition === scrollHeight;
|
||||
|
||||
window.autosize(this.$messageField);
|
||||
$bottomBar.outerHeight(this.$messageField.outerHeight() + 1);
|
||||
var $bottomBarNewHeight = $bottomBar.outerHeight();
|
||||
$discussionContainer.outerHeight(this.$el.outerHeight() - $bottomBarNewHeight - this.$('#header').outerHeight());
|
||||
|
||||
if (shouldStickToBottom) {
|
||||
$messageList.scrollTop(scrollHeight);
|
||||
}
|
||||
},
|
||||
|
||||
forceUpdateMessageFieldSize: function (event) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue