diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2016-01-20 14:57:34 -0500 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2016-01-20 14:58:32 -0500 |
commit | e4cea41cbf678f553ffffd9c9fdb86e3d35bc0ca (patch) | |
tree | 567f4eeca7cae59f05a5c931c926821437efd0e2 /web/react/components | |
parent | d8149fb26982eab00f632d8bfc98f6a9cceebca6 (diff) | |
download | chat-e4cea41cbf678f553ffffd9c9fdb86e3d35bc0ca.tar.gz chat-e4cea41cbf678f553ffffd9c9fdb86e3d35bc0ca.tar.bz2 chat-e4cea41cbf678f553ffffd9c9fdb86e3d35bc0ca.zip |
Added a small margin where the PostsView will be considered to be at the bottom even if it's not exactly at the bottom
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/posts_view.jsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/web/react/components/posts_view.jsx b/web/react/components/posts_view.jsx index 7d8c7e265..856403af5 100644 --- a/web/react/components/posts_view.jsx +++ b/web/react/components/posts_view.jsx @@ -57,7 +57,10 @@ export default class PostsView extends React.Component { this.setState({displayNameType: PreferenceStore.get(Preferences.CATEGORY_DISPLAY_SETTINGS, 'name_format', 'false')}); } isAtBottom() { - return ((this.refs.postlist.scrollHeight - this.refs.postlist.scrollTop) === this.refs.postlist.clientHeight); + // consider the view to be at the bottom if it's within this many pixels of the bottom + const atBottomMargin = 10; + + return this.refs.postlist.clientHeight + this.refs.postlist.scrollTop >= this.refs.postlist.scrollHeight - atBottomMargin; } handleScroll() { // HACK FOR RHS -- REMOVE WHEN RHS DIES |