From e6f2d14fee2cce8e9ddba103e2413ac6424baf6a Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 9 Feb 2023 13:19:37 +0100 Subject: [PATCH 1/2] the first 50px are excluded from the scrolling hide mechanism --- webapp/components/HeaderMenu/HeaderMenu.vue | 10 ++++++---- webapp/pages/index.vue | 12 +++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/webapp/components/HeaderMenu/HeaderMenu.vue b/webapp/components/HeaderMenu/HeaderMenu.vue index c63bba4fe..dce7de88a 100644 --- a/webapp/components/HeaderMenu/HeaderMenu.vue +++ b/webapp/components/HeaderMenu/HeaderMenu.vue @@ -300,10 +300,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 }, diff --git a/webapp/pages/index.vue b/webapp/pages/index.vue index 37c07eeab..55a0b8931 100644 --- a/webapp/pages/index.vue +++ b/webapp/pages/index.vue @@ -213,11 +213,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 From 8e8565810cfd85a694fcd2f64d02b5b36ea749f3 Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 9 Feb 2023 13:39:30 +0100 Subject: [PATCH 2/2] fix lint --- webapp/components/HeaderMenu/HeaderMenu.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/components/HeaderMenu/HeaderMenu.vue b/webapp/components/HeaderMenu/HeaderMenu.vue index aa87b1620..6fd3699a3 100644 --- a/webapp/components/HeaderMenu/HeaderMenu.vue +++ b/webapp/components/HeaderMenu/HeaderMenu.vue @@ -314,7 +314,7 @@ export default { this.hideNavbar = false } else { this.hideNavbar = true - } + } } this.prevScrollpos = currentScrollPos },