summaryrefslogtreecommitdiffstats
path: root/web/react/components/post_list.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-09-25 13:04:35 -0400
committerJoram Wilander <jwawilander@gmail.com>2015-09-25 13:04:35 -0400
commit3d2f29f5613d848486fe6fc6219a2b0f2647095f (patch)
tree383bbbc57d18e074f309bfad388f5ae004ffddea /web/react/components/post_list.jsx
parenteb16b4fdf907b294b18a56af0636b204624e8016 (diff)
parent425797eb3825b4d9f76302512bc60c552180d6fe (diff)
downloadchat-3d2f29f5613d848486fe6fc6219a2b0f2647095f.tar.gz
chat-3d2f29f5613d848486fe6fc6219a2b0f2647095f.tar.bz2
chat-3d2f29f5613d848486fe6fc6219a2b0f2647095f.zip
Merge pull request #809 from mattermost/scrolling-partial-fix
Partial fix to scrolling issues. No longer jumps up from the bottom when RHS opens
Diffstat (limited to 'web/react/components/post_list.jsx')
-rw-r--r--web/react/components/post_list.jsx16
1 files changed, 8 insertions, 8 deletions
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx
index 218922b67..3e1e075bb 100644
--- a/web/react/components/post_list.jsx
+++ b/web/react/components/post_list.jsx
@@ -105,18 +105,18 @@ export default class PostList extends React.Component {
UserStore.addStatusesChangeListener(this.onTimeChange);
SocketStore.addChangeListener(this.onSocketChange);
- var postHolder = $(React.findDOMNode(this.refs.postlist));
+ const postHolder = $(React.findDOMNode(this.refs.postlist));
- $(window).on('resize.' + this.props.channelId, function resize() {
+ $(window).resize(() => {
this.resize();
if (!this.scrolled) {
this.scrollToBottom();
}
- }.bind(this));
+ });
- postHolder.on('scroll', function scroll() {
- var position = postHolder.scrollTop() + postHolder.height() + 14;
- var bottom = postHolder[0].scrollHeight;
+ postHolder.on('scroll', () => {
+ const position = postHolder.scrollTop() + postHolder.height() + 14;
+ const bottom = postHolder[0].scrollHeight;
if (position >= bottom) {
this.scrolled = false;
@@ -128,7 +128,7 @@ export default class PostList extends React.Component {
this.userHasSeenNew = true;
}
this.isUserScroll = true;
- }.bind(this));
+ });
$('.post-list__content div .post').removeClass('post--last');
$('.post-list__content div:last-child .post').addClass('post--last');
@@ -146,7 +146,7 @@ export default class PostList extends React.Component {
UserStore.removeStatusesChangeListener(this.onTimeChange);
SocketStore.removeChangeListener(this.onSocketChange);
$('body').off('click.userpopover');
- $(window).off('resize.' + this.props.channelId);
+ $(window).off('resize');
var postHolder = $(React.findDOMNode(this.refs.postlist));
postHolder.off('scroll');
}