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 --- .../flavours/glitch/features/account_gallery/index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours/glitch/features/account_gallery/index.js') diff --git a/app/javascript/flavours/glitch/features/account_gallery/index.js b/app/javascript/flavours/glitch/features/account_gallery/index.js index a9ea5088e..63c1b2d86 100644 --- a/app/javascript/flavours/glitch/features/account_gallery/index.js +++ b/app/javascript/flavours/glitch/features/account_gallery/index.js @@ -65,6 +65,10 @@ export default class AccountGallery extends ImmutablePureComponent { } } + handleHeaderClick = () => { + this.column.scrollTop(); + } + handleScrollToBottom = () => { if (this.props.hasMore) { this.handleLoadMore(this.props.medias.size > 0 ? this.props.medias.last().getIn(['status', 'id']) : undefined); @@ -94,6 +98,10 @@ export default class AccountGallery extends ImmutablePureComponent { return !(location.state && location.state.mastodonModalOpen); } + setRef = c => { + this.column = c; + } + render () { const { medias, isLoading, hasMore } = this.props; @@ -112,8 +120,8 @@ export default class AccountGallery extends ImmutablePureComponent { } return ( - - + +
-- cgit