diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-12-03 21:04:57 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-12-03 21:04:57 +0100 |
commit | 565cd95bcae1f3814c46191a3f22289313620321 (patch) | |
tree | 3a22496bc9c40436b15cad4e6718c0b1f2203eeb /app/assets/javascripts/components/components/status_list.jsx | |
parent | b14b5e3b448eafa1489d6fe4b702621e25dff1ae (diff) |
Keep timelines in the UI trimmed when possible
Diffstat (limited to 'app/assets/javascripts/components/components/status_list.jsx')
-rw-r--r-- | app/assets/javascripts/components/components/status_list.jsx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/assets/javascripts/components/components/status_list.jsx b/app/assets/javascripts/components/components/status_list.jsx index f989ef895..b48d94405 100644 --- a/app/assets/javascripts/components/components/status_list.jsx +++ b/app/assets/javascripts/components/components/status_list.jsx @@ -1,14 +1,16 @@ -import Status from './status'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import PureRenderMixin from 'react-addons-pure-render-mixin'; +import Status from './status'; +import ImmutablePropTypes from 'react-immutable-proptypes'; +import PureRenderMixin from 'react-addons-pure-render-mixin'; import { ScrollContainer } from 'react-router-scroll'; -import StatusContainer from '../containers/status_container'; +import StatusContainer from '../containers/status_container'; const StatusList = React.createClass({ propTypes: { statusIds: ImmutablePropTypes.list.isRequired, onScrollToBottom: React.PropTypes.func, + onScrollToTop: React.PropTypes.func, + onScroll: React.PropTypes.func, trackScroll: React.PropTypes.bool }, @@ -27,6 +29,10 @@ const StatusList = React.createClass({ if (scrollTop === scrollHeight - clientHeight) { this.props.onScrollToBottom(); + } else if (scrollTop < 100) { + this.props.onScrollToTop(); + } else { + this.props.onScroll(); } }, |