Skip to content

Commit

Permalink
fix(affix.directive): use settimeout instead of delay
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyBGod committed Jun 10, 2016
1 parent 40e6150 commit 458156a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugin/affix.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ export class ScrollSpyAffixDirective implements AfterViewInit, OnDestroy {
this.elementBottom = this.elementTop + getDOM().getBoundingClientRect(this.parentEl).height;

if (!!this.scrollSpy.getObservable('window')) {
// TODO: Remove delay once: https://github.com/angular/angular/issues/7443
this.scrollStream$ = this.scrollSpy.getObservable('window').delay(0).subscribe((e: any) => {
this.update(e.target.scrollingElement.scrollTop);
// TODO: Remove setTimeout once: https://github.com/angular/angular/issues/7443
this.scrollStream$ = this.scrollSpy.getObservable('window').subscribe((e: any) => {
setTimeout(() => this.update(e.target.scrollingElement.scrollTop));
});
}
}
Expand Down

0 comments on commit 458156a

Please sign in to comment.