Skip to content

Commit bddc003

Browse files
authored
Merge branch 'OpenBMB:main' into feature/add-template-edge-processor
2 parents 8ee9058 + 75e889d commit bddc003

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

frontend/src/components/Sidebar.vue

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,21 @@ const handleScroll = (e) => {
6161
lastScrollY = currentScrollY <= 0 ? 0 : currentScrollY;
6262
}
6363
64-
onMounted(() => {
65-
// Listen to scroll events during the capture phase to track child scrolling (like TutorialView)
66-
window.addEventListener('scroll', handleScroll, true);
67-
})
64+
const toggleScrollListener = (shouldListen) => {
65+
if (shouldListen) {
66+
window.addEventListener('scroll', handleScroll, true);
67+
} else {
68+
window.removeEventListener('scroll', handleScroll, true);
69+
isHidden.value = false; // Reset state when leaving
70+
}
71+
}
72+
73+
watch(() => route.path, () => {
74+
toggleScrollListener(!!route.meta.hideNavOnScroll);
75+
}, { immediate: true }) // immediate: true runs this once on mount
6876
6977
onUnmounted(() => {
70-
window.removeEventListener('scroll', handleScroll, true);
78+
toggleScrollListener(false);
7179
document.body.classList.remove('nav-hidden');
7280
})
7381
</script>

frontend/src/router/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ const routes = [
77
},
88
{
99
path: '/tutorial',
10-
component: () => import('../pages/TutorialView.vue')
10+
component: () => import('../pages/TutorialView.vue'),
11+
meta: { hideNavOnScroll: true }
1112
},
1213
{
1314
path: '/launch',

0 commit comments

Comments
 (0)