Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Commit b194006

Browse files
Merge pull request #539 from GSA/BugFixes
added faint gray lines to sidebar and fixed bug with homepage not sta…
2 parents f52e7ac + f797be9 commit b194006

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
"@angularclass/hmr-loader": "~3.0.2",
113113
"@code.gov/api-client": "^0.1.1",
114114
"@code.gov/code-gov-font": "^0.5.0",
115-
"@code.gov/code-gov-style": "^1.0.1",
115+
"@code.gov/code-gov-style": "^1.0.2",
116116
"@ngx-meta/core": "^0.4.0-rc.2",
117117
"@types/jasminewd2": "^2.0.2",
118118
"angulartics2": "1.4.3",

src/app/components/home/home.component.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { Component, OnInit, AfterViewInit } from '@angular/core';
22
import { Router, NavigationEnd } from '@angular/router';
33

44
import { SeoService } from '../../services/seo';
@@ -13,7 +13,7 @@ import * as SiteConfig from '../../../../config/code-gov-config.json';
1313
styles: [require('./home.style.scss')],
1414
template: require('./home.template.html')
1515
})
16-
export class HomeComponent implements OnInit {
16+
export class HomeComponent implements OnInit, AfterViewInit {
1717

1818
constructor(
1919
public stateService: StateService,
@@ -28,14 +28,17 @@ export class HomeComponent implements OnInit {
2828
);
2929
}
3030

31-
ngOnInit() {
31+
ngOnInit(): void {
3232
// fixes weird issue where would start on home page scrolled down somewhat
33-
this.router.events.subscribe((evt) => {
34-
if (!(evt instanceof NavigationEnd)) {
35-
return;
36-
}
37-
window.scrollTo(0, 0);
38-
});
33+
window.scrollTo(0, 0);
34+
}
35+
36+
ngAfterViewInit(): void {
37+
/*
38+
fixes weird issue where would start on home page scrolled down somewhat
39+
This is called each time the use switches to the home page.
40+
*/
41+
window.scrollTo(0, 0);
3942
}
4043

4144
scrollToAbout() {

0 commit comments

Comments
 (0)