mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 21:48:42 +08:00
chore(components): ngmodule updates
This commit is contained in:
@ -1,9 +1,7 @@
|
||||
import { Component, Input, ViewEncapsulation } from '@angular/core';
|
||||
import { NgIf } from '@angular/common';
|
||||
|
||||
import { Config } from '../../config/config';
|
||||
import { InfiniteScroll } from './infinite-scroll';
|
||||
import { Spinner } from '../spinner/spinner';
|
||||
|
||||
|
||||
/**
|
||||
@ -18,7 +16,6 @@ import { Spinner } from '../spinner/spinner';
|
||||
'</div>' +
|
||||
'<div class="infinite-loading-text" [innerHTML]="loadingText" *ngIf="loadingText"></div>' +
|
||||
'</div>',
|
||||
directives: [NgIf, Spinner],
|
||||
host: {
|
||||
'[attr.state]': 'inf.state'
|
||||
},
|
||||
@ -36,7 +33,7 @@ export class InfiniteScrollContent {
|
||||
*/
|
||||
@Input() loadingText: string;
|
||||
|
||||
constructor(private inf: InfiniteScroll, private _config: Config) {}
|
||||
constructor(public inf: InfiniteScroll, private _config: Config) {}
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
@ -95,13 +95,13 @@ import { Content } from '../content/content';
|
||||
selector: 'ion-infinite-scroll'
|
||||
})
|
||||
export class InfiniteScroll {
|
||||
private _lastCheck: number = 0;
|
||||
private _highestY: number = 0;
|
||||
private _scLsn: Function;
|
||||
private _thr: string = '15%';
|
||||
private _thrPx: number = 0;
|
||||
private _thrPc: number = 0.15;
|
||||
private _init: boolean = false;
|
||||
_lastCheck: number = 0;
|
||||
_highestY: number = 0;
|
||||
_scLsn: Function;
|
||||
_thr: string = '15%';
|
||||
_thrPx: number = 0;
|
||||
_thrPc: number = 0.15;
|
||||
_init: boolean = false;
|
||||
|
||||
state: string = STATE_ENABLED;
|
||||
|
||||
@ -144,10 +144,10 @@ export class InfiniteScroll {
|
||||
private _zone: NgZone,
|
||||
private _elementRef: ElementRef
|
||||
) {
|
||||
_content.addCssClass('has-infinite-scroll');
|
||||
_content.setElementClass('has-infinite-scroll', true);
|
||||
}
|
||||
|
||||
private _onScroll() {
|
||||
_onScroll() {
|
||||
if (this.state === STATE_LOADING || this.state === STATE_DISABLED) {
|
||||
return 1;
|
||||
}
|
||||
@ -217,7 +217,7 @@ export class InfiniteScroll {
|
||||
this._setListeners(shouldEnable);
|
||||
}
|
||||
|
||||
private _setListeners(shouldListen: boolean) {
|
||||
_setListeners(shouldListen: boolean) {
|
||||
if (this._init) {
|
||||
if (shouldListen) {
|
||||
if (!this._scLsn) {
|
||||
|
Reference in New Issue
Block a user