mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-01-15 22:15:30 +01:00
code reformat to follow the styles
This commit is contained in:
parent
669b3df4b5
commit
a8cd300ecc
26 changed files with 193 additions and 187 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue