mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(transition): default to ios-transition if animation not found
This commit is contained in:
@@ -539,11 +539,10 @@ export class Animation {
|
||||
}
|
||||
|
||||
static createTransition(enteringView, leavingView, opts = {}) {
|
||||
const name = opts.animation || 'ios-transition';
|
||||
|
||||
let TransitionClass = AnimationRegistry[name];
|
||||
let TransitionClass = AnimationRegistry[opts.animation];
|
||||
if (!TransitionClass) {
|
||||
TransitionClass = Animation;
|
||||
// didn't find a transition animation, default to ios-transition
|
||||
TransitionClass = AnimationRegistry['ios-transition'];
|
||||
}
|
||||
|
||||
return new TransitionClass(enteringView, leavingView, opts);
|
||||
|
||||
@@ -174,7 +174,7 @@ class ModalFirstPage {
|
||||
push() {
|
||||
let page = ModalSecondPage;
|
||||
let params = { id: 8675309, myData: [1,2,3,4] };
|
||||
let opts = { animation: 'ios' };
|
||||
let opts = { animation: 'ios-transition' };
|
||||
|
||||
this.nav.push(page, params, opts);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user