mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Merge branch 'master' into 3.0
This commit is contained in:
@@ -72,6 +72,7 @@ import { AlertInputOptions, AlertOptions, AlertButton } from './alert-options';
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
})
|
||||
export class AlertCmp {
|
||||
|
||||
activeId: string;
|
||||
descId: string;
|
||||
d: AlertOptions;
|
||||
|
||||
@@ -27,5 +27,6 @@ export interface AlertInputOptions {
|
||||
export interface AlertButton {
|
||||
text?: string;
|
||||
role?: string;
|
||||
cssClass?: string;
|
||||
handler?: Function;
|
||||
};
|
||||
|
||||
@@ -33,6 +33,7 @@ export class PageOne {
|
||||
alert.addButton({
|
||||
text: 'Cancel',
|
||||
role: 'cancel',
|
||||
cssClass: 'secondary',
|
||||
handler: () => {
|
||||
console.log('Confirm Cancel');
|
||||
this.testConfirmResult = 'Cancel';
|
||||
|
||||
63
src/components/img/test/basic/app.module.ts
Normal file
63
src/components/img/test/basic/app.module.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import { Component, Input, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from '../../../../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: '<my-img>',
|
||||
template: '<ion-img [width]="width" [height]="height" [src]="src"></ion-img>'
|
||||
})
|
||||
export class MyImg {
|
||||
@Input() width: any;
|
||||
@Input() height: any;
|
||||
@Input() src: any;
|
||||
}
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
export class E2EPage {
|
||||
images = [
|
||||
{
|
||||
width: '100',
|
||||
height: '44',
|
||||
src: '../img/batmobile.jpg'
|
||||
},
|
||||
{
|
||||
width: '100',
|
||||
height: '75',
|
||||
src: '../img/knight-rider.jpg'
|
||||
},
|
||||
{
|
||||
width: '100',
|
||||
height: '68',
|
||||
src: '../img/general-lee.jpg'
|
||||
}
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class E2EApp {
|
||||
root = E2EPage;
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
E2EApp,
|
||||
E2EPage,
|
||||
MyImg
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(E2EApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
E2EApp,
|
||||
E2EPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
@@ -256,7 +256,7 @@ export class InfiniteScroll {
|
||||
let distanceFromInfinite: number;
|
||||
|
||||
if (this._position === POSITION_BOTTOM) {
|
||||
distanceFromInfinite = ((d.scrollHeight - infiniteHeight) - d.scrollTop) - height - threshold;
|
||||
distanceFromInfinite = d.scrollHeight - infiniteHeight - d.scrollTop - height - threshold;
|
||||
} else {
|
||||
assert(this._position === POSITION_TOP, '_position should be top');
|
||||
distanceFromInfinite = d.scrollTop - infiniteHeight - threshold;
|
||||
@@ -289,6 +289,10 @@ export class InfiniteScroll {
|
||||
* to `enabled`.
|
||||
*/
|
||||
complete() {
|
||||
if (this.state !== STATE_LOADING) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._position === POSITION_BOTTOM) {
|
||||
this.state = STATE_ENABLED;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user