From e2b42d16a4086958ed1cda8f209b0520f8df3545 Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 8 Dec 2023 18:55:06 +0100 Subject: [PATCH] poprawki scrollBehavior --- src/App.scss | 2 +- src/router/index.ts | 4 +--- src/views/SceneryView.vue | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/App.scss b/src/App.scss index 8acd474..493035e 100644 --- a/src/App.scss +++ b/src/App.scss @@ -31,7 +31,7 @@ // CONTAINER .app_container { display: grid; - grid-template-rows: auto 1fr auto; + grid-template-rows: auto minmax(100vh, 1fr) auto; grid-template-columns: 100%; min-height: 100vh; diff --git a/src/router/index.ts b/src/router/index.ts index b55a9ce..c76dcad 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -61,12 +61,10 @@ const routes: Array = [ const router = createRouter({ scrollBehavior(to, from, savedPosition) { - if (to.name == 'SceneryView' && from.name && from.query['view'] === undefined) + if (to.name == 'SceneryView' && from.name !== to.name && from.query['view'] === undefined) return { el: `.app_main` }; if (savedPosition) return savedPosition; - - // if (from.name == 'SceneryView' && to.name == 'StationsView') return { el: `.last-selected`, top: 20 }; }, history: createWebHistory(), routes diff --git a/src/views/SceneryView.vue b/src/views/SceneryView.vue index 454d2e7..5dda0d6 100644 --- a/src/views/SceneryView.vue +++ b/src/views/SceneryView.vue @@ -201,8 +201,6 @@ button.back-btn { &-view { display: flex; justify-content: center; - - min-height: 100vh; } &-offline { @@ -231,6 +229,7 @@ button.back-btn { width: 100%; max-width: 1700px; + min-height: 100vh; margin: 1rem 0; text-align: center;