Merge pull request #5957 from Ocelot-Social-Community/5953-navbar-disappears-when-scrolling-to-top

fix(webapp): navbar disappears when scrolling to top
This commit is contained in:
Alexander Friedland 2023-02-09 16:04:40 +01:00 committed by GitHub
commit 982257b5f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 9 deletions

View File

@ -309,10 +309,12 @@ export default {
methods: { methods: {
handleScroll() { handleScroll() {
const currentScrollPos = window.pageYOffset const currentScrollPos = window.pageYOffset
if (this.prevScrollpos > currentScrollPos) { if (this.prevScrollpos > 50) {
this.hideNavbar = false if (this.prevScrollpos > currentScrollPos) {
} else { this.hideNavbar = false
this.hideNavbar = true } else {
this.hideNavbar = true
}
} }
this.prevScrollpos = currentScrollPos this.prevScrollpos = currentScrollPos
}, },

View File

@ -214,11 +214,13 @@ export default {
}, },
handleScroll() { handleScroll() {
const currentScrollPos = window.pageYOffset const currentScrollPos = window.pageYOffset
if (this.prevScrollpos > currentScrollPos) { if (this.prevScrollpos > 50) {
this.hideByScroll = false if (this.prevScrollpos > currentScrollPos) {
} else { this.hideByScroll = false
if (!this.showFilter) { } else {
this.hideByScroll = true if (!this.showFilter) {
this.hideByScroll = true
}
} }
} }
this.prevScrollpos = currentScrollPos this.prevScrollpos = currentScrollPos