diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-03-08 20:34:31 +0100 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2019-03-11 14:19:16 +0100 |
commit | 4849eb8e7f58e9f1da73422fa71dbb07d6ff1db5 (patch) | |
tree | 2bb244097081e3eae2c4c7e7684476a88b05f13c /app/javascript/flavours/glitch/features/account_timeline | |
parent | 45e4c90a23ccd6ccbed389d5c1b62f830d2c3757 (diff) |
Make clicking on the account and status column headers scroll to top
Diffstat (limited to 'app/javascript/flavours/glitch/features/account_timeline')
-rw-r--r-- | app/javascript/flavours/glitch/features/account_timeline/index.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/features/account_timeline/index.js b/app/javascript/flavours/glitch/features/account_timeline/index.js index 415e3be20..d683b8789 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/index.js +++ b/app/javascript/flavours/glitch/features/account_timeline/index.js @@ -57,10 +57,18 @@ export default class AccountTimeline extends ImmutablePureComponent { } } + handleHeaderClick = () => { + this.column.scrollTop(); + } + handleLoadMore = maxId => { this.props.dispatch(expandAccountTimeline(this.props.params.accountId, { maxId, withReplies: this.props.withReplies })); } + setRef = c => { + this.column = c; + } + render () { const { statusIds, featuredStatusIds, isLoading, hasMore } = this.props; @@ -73,8 +81,8 @@ export default class AccountTimeline extends ImmutablePureComponent { } return ( - <Column name='account'> - <ProfileColumnHeader /> + <Column ref={this.setRef} name='account'> + <ProfileColumnHeader onClick={this.handleHeaderClick} /> <StatusList prepend={<HeaderContainer accountId={this.props.params.accountId} />} |