From 275bd827923e8133a1a2db0da96481d08dcfb73f Mon Sep 17 00:00:00 2001 From: Christina Toegl <toegl@tugraz.at> Date: Wed, 18 Nov 2020 11:53:38 +0100 Subject: [PATCH] Change scrolling behaviour to sticky menu instead of top (#37) --- packages/app-shell/src/app-shell.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/app-shell/src/app-shell.js b/packages/app-shell/src/app-shell.js index 933c4bd5..4cc74fe0 100644 --- a/packages/app-shell/src/app-shell.js +++ b/packages/app-shell/src/app-shell.js @@ -350,10 +350,13 @@ export class AppShell extends ScopedElementsMixin(LitElement) { } let updateFunc = () => { - window.scrollTo({ top: 0, left: 0, behavior: "auto" }); + if (window.pageYOffset !== 0) { + window.scrollTo(0, 96); + } this.updatePageTitle(); this.subtitle = this.activeMetaDataText("short_name"); this.description = this.activeMetaDataText("description"); + }; // If it is empty assume the element is already registered through other means @@ -641,6 +644,8 @@ export class AppShell extends ScopedElementsMixin(LitElement) { ul.menu.hidden { display: none; } + + } `; } -- GitLab