mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Fade in modal
This commit is contained in:
@@ -137,7 +137,7 @@ export class IonicApp {
|
||||
selector: 'settings-modal'
|
||||
})
|
||||
@View({
|
||||
template: '<ion-view><ion-content padding><button primary (click)="close()">Close</button></ion-content></ion-view>',
|
||||
template: '<ion-view><ion-content padding><button icon (click)="close()"><i class="icon ion-close"></i></button></ion-content></ion-view>',
|
||||
directives: [Nav, Button, Content]
|
||||
})
|
||||
export class SettingsModal {
|
||||
|
||||
@@ -69,6 +69,8 @@ export class Modal {
|
||||
|
||||
modalRef.containerRef = containerRef;
|
||||
|
||||
modalRef.setOptions(this.opts);
|
||||
|
||||
// Now load the user's modal component into the Modal
|
||||
return this.componentLoader.loadNextToExistingLocation(
|
||||
this.modalType, containerRef.instance.contentRef, contentInjector).then(contentRef => {
|
||||
@@ -82,11 +84,11 @@ export class Modal {
|
||||
}
|
||||
|
||||
show() {
|
||||
return this._modalRef.open(this.opts.openAnimation);
|
||||
return this._modalRef.open();
|
||||
}
|
||||
|
||||
close() {
|
||||
return this._modalRef.close(this.opts.closeAnimation);
|
||||
return this._modalRef.close();
|
||||
}
|
||||
|
||||
|
||||
@@ -118,6 +120,7 @@ class ModalContainer {
|
||||
}
|
||||
|
||||
close(animation) {
|
||||
console.log('Closing w/ anim', animation);
|
||||
var slideOut = Animation.create(this.domElement, animation);
|
||||
return slideOut.play();
|
||||
}
|
||||
@@ -139,15 +142,19 @@ export class ModalRef {
|
||||
this.isClosed = false;
|
||||
}
|
||||
|
||||
open(animation) {
|
||||
this.containerRef.instance.open(animation).then(() => {
|
||||
setOptions(opts) {
|
||||
this.opts = opts;
|
||||
}
|
||||
|
||||
open() {
|
||||
this.containerRef.instance.open(this.opts.openAnimation).then(() => {
|
||||
this.isClosed = false;
|
||||
})
|
||||
}
|
||||
|
||||
close(animation) {
|
||||
close() {
|
||||
// Close, then dispose y'all
|
||||
this.containerRef.instance.close(animation).then(() => {
|
||||
this.containerRef.instance.close(this.opts.closeAnimation).then(() => {
|
||||
this.isClosed = true;
|
||||
this.containerRef.dispose();
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user