diff --git a/webapp/pages/index.vue b/webapp/pages/index.vue index 921724f85..d300ed7ec 100644 --- a/webapp/pages/index.vue +++ b/webapp/pages/index.vue @@ -5,12 +5,12 @@ - - - - {{ $t('contribution.filterMasonryGrid.myTheme') }} @@ -48,16 +35,7 @@ style="margin-left: -8px" filled /> - - - {{ $t('contribution.filterMasonryGrid.myFriends') }} @@ -70,22 +48,6 @@ style="margin-left: -8px" filled /> - - - @@ -177,6 +138,8 @@ export default { data() { const { hashtag = null } = this.$route.query return { + hideFilter: false, + revScrollpos: 0, showFilter: false, showDonations: true, goal: 15000, @@ -225,6 +188,7 @@ export default { this.toggleCategory(this.categoryId) } document.addEventListener('click', this.showFilterMenu) + window.addEventListener('scroll', this.handleScroll) }, methods: { ...mapMutations({ @@ -238,6 +202,15 @@ export default { this.showFilter = false } }, + handleScroll() { + const currentScrollPos = window.pageYOffset + if (this.prevScrollpos > currentScrollPos) { + this.hideFilter = false + } else { + this.hideFilter = true + } + this.prevScrollpos = currentScrollPos + }, beforeDestroy() { document.removeEventListener('click', this.showFilterMenu) }, @@ -326,6 +299,10 @@ export default { } } +.hide-filter { + display: none; +} + .base-button.--circle.post-add-button { height: 54px; width: 54px;