From 8c7bfc6da2f0ca9953650851c74b4bdeecd01cac Mon Sep 17 00:00:00 2001 From: mhartington Date: Tue, 2 Feb 2016 12:41:05 -0500 Subject: [PATCH] docs(pullToRefresh): update docs --- ionic/components/scroll/pull-to-refresh.ts | 122 +++++++++++++++++++-- 1 file changed, 111 insertions(+), 11 deletions(-) diff --git a/ionic/components/scroll/pull-to-refresh.ts b/ionic/components/scroll/pull-to-refresh.ts index 469ee8e0cb..a429d404cd 100644 --- a/ionic/components/scroll/pull-to-refresh.ts +++ b/ionic/components/scroll/pull-to-refresh.ts @@ -81,54 +81,154 @@ import {raf, ready, CSS} from '../../util/dom'; directives: [NgIf, NgClass, Icon] }) export class Refresher { - private ele: HTMLElement; + private _ele: HTMLElement; private _touchMoveListener; private _touchEndListener; private _handleScrollListener; + + /** + * @private + */ isActive: boolean; + + /** + * @private + */ isDragging: boolean = false; + + /** + * @private + */ isOverscrolling: boolean = false; + + /** + * @private + */ dragOffset: number = 0; + + /** + * @private + */ lastOverscroll: number = 0; + + /** + * @private + */ ptrThreshold: number = 0; + + /** + * @private + */ activated: boolean = false; + + /** + * @private + */ scrollTime: number = 500; + + /** + * @private + */ canOverscroll: boolean = true; + + /** + * @private + */ startY; + + /** + * @private + */ deltaY; + + /** + * @private + */ scrollHost; + + /** + * @private + */ scrollChild; + + /** + * @private + */ showIcon: boolean; + + /** + * @private + */ showSpinner: boolean; + + /** + * @private + */ isRefreshing: boolean; + + /** + * @private + */ isRefreshingTail: boolean; + + /** + * @private + */ @Input() pullingIcon: string; + + /** + * @private + */ @Input() pullingText: string; + + /** + * @private + */ @Input() refreshingIcon: string; + + /** + * @private + */ @Input() refreshingText: string; + + /** + * @private + */ @Input() spinner: string; + + /** + * @private + */ @Output() pulling: EventEmitter = new EventEmitter(); + + /** + * @private + */ @Output() refresh: EventEmitter = new EventEmitter(); + + /** + * @private + */ @Output() starting: EventEmitter = new EventEmitter(); constructor( - @Host() private content: Content, - element: ElementRef + @Host() private _content: Content, + _element: ElementRef ) { - this.ele = element.nativeElement; - this.ele.classList.add('content'); + this._ele = _element.nativeElement; + this._ele.classList.add('content'); } /** * @private */ ngOnInit() { - let sp = this.content.getNativeElement(); - let sc = this.content.scrollElement; + let sp = this._content.getNativeElement(); + let sc = this._content.scrollElement; this.startY = null; this.deltaY = null; @@ -156,7 +256,7 @@ export class Refresher { * @private */ ngOnDestroy() { - let sc = this.content.scrollElement; + let sc = this._content.scrollElement; sc.removeEventListener('touchmove', this._touchMoveListener); sc.removeEventListener('touchend', this._touchEndListener); sc.removeEventListener('scroll', this._handleScrollListener); @@ -245,7 +345,7 @@ export class Refresher { */ show() { // showCallback - this.ele.classList.remove('invisible'); + this._ele.classList.remove('invisible'); } /** @@ -253,7 +353,7 @@ export class Refresher { */ hide() { // showCallback - this.ele.classList.add('invisible'); + this._ele.classList.add('invisible'); } /** @@ -261,7 +361,7 @@ export class Refresher { */ tail() { // tailCallback - this.ele.classList.add('refreshing-tail'); + this._ele.classList.add('refreshing-tail'); } /**