about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/account_timeline/index.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-03-08 20:34:31 +0100
committerThibG <thib@sitedethib.com>2019-03-11 14:19:16 +0100
commit4849eb8e7f58e9f1da73422fa71dbb07d6ff1db5 (patch)
tree2bb244097081e3eae2c4c7e7684476a88b05f13c /app/javascript/flavours/glitch/features/account_timeline/index.js
parent45e4c90a23ccd6ccbed389d5c1b62f830d2c3757 (diff)
Make clicking on the account and status column headers scroll to top
Diffstat (limited to 'app/javascript/flavours/glitch/features/account_timeline/index.js')
-rw-r--r--app/javascript/flavours/glitch/features/account_timeline/index.js12
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} />}