mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
refactor(pull-to-refresh): rename the starting event to start
updated docs to reflect new name and renamed an internal function BREAKING CHANGE: starting event no longer exists, must use start References #5207
This commit is contained in:
@ -18,7 +18,7 @@ import {raf, ready, CSS} from '../../util/dom';
|
|||||||
* @usage
|
* @usage
|
||||||
* ```html
|
* ```html
|
||||||
* <ion-content>
|
* <ion-content>
|
||||||
* <ion-refresher (starting)="doStarting($event)"
|
* <ion-refresher (start)="doStart($event)"
|
||||||
* (refresh)="doRefresh($event)"
|
* (refresh)="doRefresh($event)"
|
||||||
* (pulling)="doPulling($event)">
|
* (pulling)="doPulling($event)">
|
||||||
* </ion-refresher>
|
* </ion-refresher>
|
||||||
@ -31,7 +31,7 @@ import {raf, ready, CSS} from '../../util/dom';
|
|||||||
* export class MyClass {
|
* export class MyClass {
|
||||||
*
|
*
|
||||||
* doRefresh(refresher) {
|
* doRefresh(refresher) {
|
||||||
* console.log('Refreshing', refresher)
|
* console.log('Doing Refresh', refresher)
|
||||||
*
|
*
|
||||||
* setTimeout(() => {
|
* setTimeout(() => {
|
||||||
* refresher.complete();
|
* refresher.complete();
|
||||||
@ -39,8 +39,8 @@ import {raf, ready, CSS} from '../../util/dom';
|
|||||||
* }, 5000);
|
* }, 5000);
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* doStarting(refresher) {
|
* doStart(refresher) {
|
||||||
* console.log('Starting', refresher);
|
* console.log('Doing Start', refresher);
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* doPulling(refresher) {
|
* doPulling(refresher) {
|
||||||
@ -204,7 +204,7 @@ export class Refresher {
|
|||||||
/**
|
/**
|
||||||
* @output {event} When you start pulling down
|
* @output {event} When you start pulling down
|
||||||
*/
|
*/
|
||||||
@Output() starting: EventEmitter<Refresher> = new EventEmitter();
|
@Output() start: EventEmitter<Refresher> = new EventEmitter();
|
||||||
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@ -305,7 +305,7 @@ export class Refresher {
|
|||||||
activate() {
|
activate() {
|
||||||
//this.ele.classList.add('active');
|
//this.ele.classList.add('active');
|
||||||
this.isActive = true;
|
this.isActive = true;
|
||||||
this.starting.emit(this);
|
this.start.emit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -325,7 +325,7 @@ export class Refresher {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
start() {
|
startRefresh() {
|
||||||
// startCallback
|
// startCallback
|
||||||
this.isRefreshing = true;
|
this.isRefreshing = true;
|
||||||
this.refresh.emit(this);
|
this.refresh.emit(this);
|
||||||
@ -522,7 +522,7 @@ export class Refresher {
|
|||||||
|
|
||||||
// the user has scroll far enough to trigger a refresh
|
// the user has scroll far enough to trigger a refresh
|
||||||
if (this.lastOverscroll > this.ptrThreshold) {
|
if (this.lastOverscroll > this.ptrThreshold) {
|
||||||
this.start();
|
this.startRefresh();
|
||||||
this.scrollTo(this.ptrThreshold, this.scrollTime);
|
this.scrollTo(this.ptrThreshold, this.scrollTime);
|
||||||
|
|
||||||
// the user has overscrolled but not far enough to trigger a refresh
|
// the user has overscrolled but not far enough to trigger a refresh
|
||||||
|
@ -14,7 +14,7 @@ class E2EApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
doRefresh(refresher) {
|
doRefresh(refresher) {
|
||||||
console.log('Refreshing', refresher)
|
console.log('Doing Refresh', refresher)
|
||||||
|
|
||||||
// Add to the top of the list on refresh
|
// Add to the top of the list on refresh
|
||||||
let firstIndex = this.items[0].index - 1;
|
let firstIndex = this.items[0].index - 1;
|
||||||
@ -29,8 +29,8 @@ class E2EApp {
|
|||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
doStarting(refresher) {
|
doStart(refresher) {
|
||||||
console.log('Starting', refresher);
|
console.log('Doing Start', refresher);
|
||||||
}
|
}
|
||||||
|
|
||||||
doPulling(refresher) {
|
doPulling(refresher) {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<ion-refresher
|
<ion-refresher
|
||||||
(starting)="doStarting($event)"
|
(start)="doStart($event)"
|
||||||
(refresh)="doRefresh($event)"
|
(refresh)="doRefresh($event)"
|
||||||
(pulling)="doPulling($event)"
|
(pulling)="doPulling($event)"
|
||||||
pullingIcon="heart"
|
pullingIcon="heart"
|
||||||
|
Reference in New Issue
Block a user