Skip to content

Commit 8fb7061

Browse files
committed
Adjust to RC4 changes.
1 parent 06395b6 commit 8fb7061

File tree

5 files changed

+20
-27
lines changed

5 files changed

+20
-27
lines changed

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@
88
"ionic:serve": "ionic-app-scripts serve"
99
},
1010
"dependencies": {
11-
"@angular/common": "2.1.1",
12-
"@angular/compiler": "2.1.1",
13-
"@angular/compiler-cli": "2.1.1",
14-
"@angular/core": "2.1.1",
15-
"@angular/forms": "2.1.1",
16-
"@angular/http": "2.1.1",
17-
"@angular/platform-browser": "2.1.1",
18-
"@angular/platform-browser-dynamic": "2.1.1",
19-
"@angular/platform-server": "2.1.1",
11+
"@angular/common": "2.2.1",
12+
"@angular/compiler": "2.2.1",
13+
"@angular/compiler-cli": "2.2.1",
14+
"@angular/core": "2.2.1",
15+
"@angular/forms": "2.2.1",
16+
"@angular/http": "2.2.1",
17+
"@angular/platform-browser": "2.2.1",
18+
"@angular/platform-browser-dynamic": "2.2.1",
19+
"@angular/platform-server": "2.2.1",
2020
"@ionic/storage": "1.1.6",
21-
"ionic-angular": "2.0.0-rc.3",
21+
"ionic-angular": "2.0.0-rc.4",
2222
"ionic-native": "2.2.3",
2323
"ionicons": "3.0.0",
2424
"lodash": "^4.17.2",
2525
"rxjs": "5.0.0-beta.12",
2626
"zone.js": "0.6.26"
2727
},
2828
"devDependencies": {
29-
"@ionic/app-scripts": "0.0.45",
29+
"@ionic/app-scripts": "0.0.48",
3030
"@types/lodash": "^4.14.41",
3131
"body-parser": "^1.15.2",
3232
"cors": "^2.8.1",

src/app/main.prod.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.
File renamed without changes.

src/components/two-way-infinite-scroll.component.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {Directive, ElementRef, EventEmitter, Host, Input, NgZone, Output} from '
22

33
import {clearNativeTimeout, nativeTimeout} from 'ionic-angular/util/dom';
44

5-
import {Content} from 'ionic-angular';
5+
import {Content,ScrollEvent} from 'ionic-angular';
66

77
/**
88
* @name InfiniteScroll
@@ -18,7 +18,7 @@ import {Content} from 'ionic-angular';
1818
export class TwoWayInfiniteScroll {
1919
_lastCheck:number = 0;
2020
_highestY:number = 0;
21-
_scLsn:Function;
21+
_scLsn:any;
2222
_thr:string = '1%';
2323
_thrPx:number = 1;
2424
_thrPc:number = 0;
@@ -127,9 +127,9 @@ export class TwoWayInfiniteScroll {
127127
}
128128

129129
// on arrive bottom
130-
//
130+
// this value might be adjusted, depending on list item height and content container height
131131
let customOffset = 100;
132-
let distanceFromInfinite = ((d.scrollHeight - infiniteHeight) - d.scrollTop) - reloadY + customOffset;
132+
let distanceFromInfinite = ((d.scrollHeight - infiniteHeight) - d.scrollTop) - reloadY - customOffset;
133133

134134
if (this.stateBottom === STATE_ENABLED && distanceFromInfinite < 0) {
135135
clearNativeTimeout(this._tmId);
@@ -209,16 +209,16 @@ export class TwoWayInfiniteScroll {
209209
// this._setListeners(shouldEnable);
210210
}
211211

212-
_setListeners(shouldListen:boolean) {
212+
_setListeners(shouldListen: boolean) {
213213
if (this._init) {
214214
if (shouldListen) {
215215
if (!this._scLsn) {
216-
this._zone.runOutsideAngular(() => {
217-
this._scLsn = this._content.addScrollListener(this._onScroll.bind(this));
216+
this._scLsn = this._content.ionScroll.subscribe((ev: ScrollEvent) => {
217+
this._onScroll();
218218
});
219219
}
220220
} else {
221-
this._scLsn && this._scLsn();
221+
this._scLsn && this._scLsn.unsubscribe();
222222
this._scLsn = null;
223223
}
224224
}

src/pages/home/home.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class HomePage {
112112
scrollContent(startIndex: number = 0) {
113113
let listItems = this.contentListParent.nativeElement.querySelectorAll('ion-item');
114114
let offsetTop = !!listItems[startIndex] && startIndex > 0 ? listItems[startIndex].offsetTop : 0;
115-
this.content.scrollTo(0, offsetTop, 0);
115+
this.content.scrollTo(0, offsetTop, 100);
116116
}
117117

118118
}

0 commit comments

Comments
 (0)