From f24b7ba67c2c2327c70809535d131d2ebec97931 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 16 Dec 2015 13:31:36 +0000 Subject: [PATCH] use RoomView.ScrollToBottom instead of reimplementing it --- src/components/structures/RoomView.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index b5df6b2e825..d22e12cde23 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -129,10 +129,7 @@ module.exports = React.createClass({ // Call state has changed so we may be loading video elements // which will obscure the message log. // scroll to bottom - var scrollNode = this._getScrollNode(); - if (scrollNode) { - scrollNode.scrollTop = scrollNode.scrollHeight; - } + this.scrollToBottom(); callState = call.call_state; } else { @@ -287,12 +284,8 @@ module.exports = React.createClass({ messagePanel.addEventListener('dragleave', this.onDragLeaveOrEnd); messagePanel.addEventListener('dragend', this.onDragLeaveOrEnd); - var messageWrapperScroll = this._getScrollNode(); - - messageWrapperScroll.scrollTop = messageWrapperScroll.scrollHeight; - + this.scrollToBottom(); this.sendReadReceipt(); - this.fillSpace(); }