code reformat to follow the styles

This commit is contained in:
nixa 2016-04-29 17:27:19 +03:00
parent 669b3df4b5
commit a8cd300ecc
26 changed files with 193 additions and 187 deletions

View file

@ -1,23 +1,24 @@
import {Directive, Input, Output, EventEmitter, HostListener, ElementRef} from 'angular2/core';
@Directive({
selector: '[scrollPosition]'
selector: '[scrollPosition]'
})
export class ScrollPosition {
@Input() maxHeight: Number;
@Output() scrollChange:EventEmitter<Boolean> = new EventEmitter<Boolean>();
@Input() maxHeight:Number;
@Output() scrollChange:EventEmitter<Boolean> = new EventEmitter<Boolean>();
private _isScrolled: Boolean;
private _isScrolled:Boolean;
ngOnInit() {
this.onWindowScroll();
ngOnInit() {
this.onWindowScroll();
}
@HostListener('window:scroll')
onWindowScroll():void {
let isScrolled = window.scrollY > this.maxHeight;
if (isScrolled !== this._isScrolled) {
this._isScrolled = isScrolled;
this.scrollChange.emit(isScrolled);
}
@HostListener('window:scroll')
onWindowScroll() : void {
let isScrolled = window.scrollY > this.maxHeight;
if (isScrolled !== this._isScrolled) {
this._isScrolled = isScrolled;
this.scrollChange.emit(isScrolled);
}
}
}
}
}