mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix modal animations
This commit is contained in:
@@ -7,7 +7,32 @@ import {Parent, Ancestor} from 'angular2/src/core/annotations_impl/visibility';
|
||||
import {IonicView} from 'ionic/ionic';
|
||||
|
||||
import {IonicComponent} from 'ionic/ionic';
|
||||
import {Modal, NavController, NavParams} from 'ionic/ionic';
|
||||
import {Modal, NavController, NavParams, Animation} from 'ionic/ionic';
|
||||
|
||||
|
||||
class FadeIn extends Animation {
|
||||
constructor(element) {
|
||||
super(element);
|
||||
this
|
||||
.easing('ease')
|
||||
.duration(450)
|
||||
.fadeIn();
|
||||
}
|
||||
}
|
||||
|
||||
Animation.register('my-fade-in', FadeIn);
|
||||
|
||||
class FadeOut extends Animation {
|
||||
constructor(element) {
|
||||
super(element);
|
||||
this
|
||||
.easing('ease')
|
||||
.duration(250)
|
||||
.fadeOut();
|
||||
}
|
||||
}
|
||||
|
||||
Animation.register('my-fade-out', FadeOut);
|
||||
|
||||
|
||||
@Component({ selector: 'ion-view' })
|
||||
@@ -16,7 +41,10 @@ import {Modal, NavController, NavParams} from 'ionic/ionic';
|
||||
})
|
||||
class IonicApp {
|
||||
openModal() {
|
||||
Modal.open(ContactModal);
|
||||
Modal.open(ContactModal, {
|
||||
enterAnimation: 'my-fade-in',
|
||||
leaveAnimation: 'my-fade-out'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +59,7 @@ export class ContactModal extends Modal {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({selector: 'ion-view'})
|
||||
@IonicView({
|
||||
template: `
|
||||
|
||||
Reference in New Issue
Block a user