Keep timelines in the UI trimmed when possible

This commit is contained in:
Eugen Rochko
2016-12-03 21:04:57 +01:00
parent b14b5e3b44
commit 565cd95bca
6 changed files with 113 additions and 41 deletions

View File

@ -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();
}
},