From 4849eb8e7f58e9f1da73422fa71dbb07d6ff1db5 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Fri, 8 Mar 2019 20:34:31 +0100 Subject: Make clicking on the account and status column headers scroll to top --- app/javascript/flavours/glitch/features/following/index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours/glitch/features/following/index.js') diff --git a/app/javascript/flavours/glitch/features/following/index.js b/app/javascript/flavours/glitch/features/following/index.js index 656100dad..3f2f091a1 100644 --- a/app/javascript/flavours/glitch/features/following/index.js +++ b/app/javascript/flavours/glitch/features/following/index.js @@ -43,6 +43,10 @@ export default class Following extends ImmutablePureComponent { } } + handleHeaderClick = () => { + this.column.scrollTop(); + } + handleScroll = (e) => { const { scrollTop, scrollHeight, clientHeight } = e.target; @@ -61,6 +65,10 @@ export default class Following extends ImmutablePureComponent { return !(location.state && location.state.mastodonModalOpen); } + setRef = c => { + this.column = c; + } + render () { const { accountIds, hasMore } = this.props; @@ -79,8 +87,8 @@ export default class Following extends ImmutablePureComponent { } return ( - - + +
-- cgit