Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions frontend/src/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,21 @@ const handleScroll = (e) => {
lastScrollY = currentScrollY <= 0 ? 0 : currentScrollY;
}

onMounted(() => {
// Listen to scroll events during the capture phase to track child scrolling (like TutorialView)
window.addEventListener('scroll', handleScroll, true);
})
const toggleScrollListener = (shouldListen) => {
if (shouldListen) {
window.addEventListener('scroll', handleScroll, true);
} else {
window.removeEventListener('scroll', handleScroll, true);
isHidden.value = false; // Reset state when leaving
}
}

watch(() => route.path, () => {
toggleScrollListener(!!route.meta.hideNavOnScroll);
}, { immediate: true }) // immediate: true runs this once on mount

onUnmounted(() => {
window.removeEventListener('scroll', handleScroll, true);
toggleScrollListener(false);
document.body.classList.remove('nav-hidden');
})
</script>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const routes = [
},
{
path: '/tutorial',
component: () => import('../pages/TutorialView.vue')
component: () => import('../pages/TutorialView.vue'),
meta: { hideNavOnScroll: true }
},
{
path: '/launch',
Expand Down