Skip to content
Snippets Groups Projects
Commit 275bd827 authored by Tögl, Christina's avatar Tögl, Christina
Browse files

Change scrolling behaviour to sticky menu instead of top (#37)

parent a774e9ba
No related branches found
No related tags found
1 merge request!10Add scroll to top when switching activities (#37)
Pipeline #14246 passed
...@@ -350,10 +350,13 @@ export class AppShell extends ScopedElementsMixin(LitElement) { ...@@ -350,10 +350,13 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
} }
let updateFunc = () => { let updateFunc = () => {
window.scrollTo({ top: 0, left: 0, behavior: "auto" }); if (window.pageYOffset !== 0) {
window.scrollTo(0, 96);
}
this.updatePageTitle(); this.updatePageTitle();
this.subtitle = this.activeMetaDataText("short_name"); this.subtitle = this.activeMetaDataText("short_name");
this.description = this.activeMetaDataText("description"); this.description = this.activeMetaDataText("description");
}; };
// If it is empty assume the element is already registered through other means // If it is empty assume the element is already registered through other means
...@@ -641,6 +644,8 @@ export class AppShell extends ScopedElementsMixin(LitElement) { ...@@ -641,6 +644,8 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
ul.menu.hidden { ul.menu.hidden {
display: none; display: none;
} }
} }
`; `;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment