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: {
handleScroll() {
const currentScrollPos = window.pageYOffset
if (this.prevScrollpos > currentScrollPos) {
this.hideNavbar = false
} else {
this.hideNavbar = true
if (this.prevScrollpos > 50) {
if (this.prevScrollpos > currentScrollPos) {
this.hideNavbar = false
} else {
this.hideNavbar = true
}
}
this.prevScrollpos = currentScrollPos
},

View File

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