Skip to content

Commit

Permalink
fix(docs): fix scroll top
Browse files Browse the repository at this point in the history
  • Loading branch information
KostyaDanovsky committed Jun 28, 2017
1 parent d309cce commit 1010404
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/app/homepage/homepage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export class ReactHomepageComponent implements AfterViewInit {

ngAfterViewInit() {
Observable.fromEvent(window, 'scroll')
// .debounceTime(50)
.subscribe(() => {
this.transparentHeader = document.body.scrollTop == 0;
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
this.transparentHeader = scrollTop == 0;
});
}
}

0 comments on commit 1010404

Please sign in to comment.