diff options
author | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-10-21 15:08:04 -0700 |
---|---|---|
committer | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-10-21 15:50:46 -0700 |
commit | 4129b204c3f6d76154f98ed715c11508d5348cc9 (patch) | |
tree | 077e298699426d31b964def2cd70faa31c7e3a40 /web/react/components/post_list.jsx | |
parent | 27a8169ae8dd41eb5a2b8a9b11e69fc4b922b115 (diff) | |
download | chat-4129b204c3f6d76154f98ed715c11508d5348cc9.tar.gz chat-4129b204c3f6d76154f98ed715c11508d5348cc9.tar.bz2 chat-4129b204c3f6d76154f98ed715c11508d5348cc9.zip |
Fixed typos in create_post.jsx resizing code
Diffstat (limited to 'web/react/components/post_list.jsx')
-rw-r--r-- | web/react/components/post_list.jsx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index 5a4e8abaf..b7df483e9 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -151,7 +151,7 @@ export default class PostList extends React.Component { this.loadFirstPosts(this.props.channelId); } - this.handleResize(); + this.resizePostList(); this.onChange(); this.scrollToBottom(); } @@ -172,6 +172,13 @@ export default class PostList extends React.Component { return; } + if (prevState.windowHeight !== this.state.windowHeight) { + this.resizePostList(); + if (!this.scrolled) { + this.scrollToBottom(); + } + } + $('.post-list__content div .post').removeClass('post--last'); $('.post-list__content div:last-child .post').addClass('post--last'); @@ -218,10 +225,6 @@ export default class PostList extends React.Component { } else { this.scrollTo(this.prevScrollTop); } - - if (prevState.windowHeight !== this.state.windowHeight) { - this.handleResize(); - } } componentWillUpdate() { var postHolder = $(ReactDOM.findDOMNode(this.refs.postlist)); @@ -238,11 +241,6 @@ export default class PostList extends React.Component { this.setState({ windowHeight: Utils.windowHeight() }); - - this.resizePostList(); - if (!this.scrolled) { - this.scrollToBottom(); - } } resizePostList() { const postHolder = $(ReactDOM.findDOMNode(this.refs.postlist)); |