Skip to content
This repository was archived by the owner on Oct 1, 2018. It is now read-only.

Commit 1ed1390

Browse files
authored
Merge pull request #170 from btroncone/master
feat(operators): scroll to top of operator container on each route change
2 parents 4432b01 + 6c75fdf commit 1ed1390

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/app/operators/components/operator/operator.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export class OperatorComponent implements OnInit {
4141
.subscribe((name: string) => {
4242
if (this.operatorsMap.has(name)) {
4343
this.operator = this.operatorsMap.get(name);
44+
this.scrollToTop();
4445
} else {
4546
this.notfound();
4647
return;
@@ -54,6 +55,14 @@ export class OperatorComponent implements OnInit {
5455
});
5556
}
5657

58+
scrollToTop() {
59+
const content = document.querySelector('.mat-drawer-content');
60+
61+
if (content) {
62+
content.scrollTop = 0;
63+
}
64+
}
65+
5766
get operatorName() {
5867
return this.operator.name;
5968
}

0 commit comments

Comments
 (0)