mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
fix(animations): fix animation-controller
This commit is contained in:
@ -1,24 +1,15 @@
|
|||||||
import { Component } from '@stencil/core';
|
import { Component } from '@stencil/core';
|
||||||
import { Animation } from './animation-interface';
|
|
||||||
import { Animator } from './animator';
|
import { Animator } from './animator';
|
||||||
import { Ionic, IonicControllerApi } from '../../index';
|
import { Ionic } from '../../index';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
tag: 'ion-animation-controller'
|
tag: 'ion-animation-controller'
|
||||||
})
|
})
|
||||||
export class AnimationController implements IonicControllerApi {
|
export class AnimationController {
|
||||||
|
|
||||||
ionViewWillLoad() {
|
ionViewWillLoad() {
|
||||||
debugger;;;
|
Ionic.registerController('animation', Animator);
|
||||||
Ionic.registerController('animation', this);
|
|
||||||
}
|
|
||||||
|
|
||||||
load(): Promise<Animation> {
|
|
||||||
return new Promise(resolve => {
|
|
||||||
debugger;
|
|
||||||
resolve((Animator as any));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@ export function transitionEnd(elm: HTMLElement, callback: {(ev?: TransitionEvent
|
|||||||
|
|
||||||
function unregister() {
|
function unregister() {
|
||||||
unRegWKTrans && unRegWKTrans();
|
unRegWKTrans && unRegWKTrans();
|
||||||
unRegWKTrans && unRegTrans();
|
unRegTrans && unRegTrans();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onTransitionEnd(ev: TransitionEvent) {
|
function onTransitionEnd(ev: TransitionEvent) {
|
||||||
@ -24,7 +24,7 @@ export function transitionEnd(elm: HTMLElement, callback: {(ev?: TransitionEvent
|
|||||||
};
|
};
|
||||||
|
|
||||||
elm.addEventListener('transitionend', onTransitionEnd, opts);
|
elm.addEventListener('transitionend', onTransitionEnd, opts);
|
||||||
unRegWKTrans = function() {
|
unRegTrans = function() {
|
||||||
elm.removeEventListener('transitionend', onTransitionEnd, opts);
|
elm.removeEventListener('transitionend', onTransitionEnd, opts);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,6 +12,9 @@ import iOSLeaveAnimation from './animations/ios.leave';
|
|||||||
ios: 'modal.ios.scss',
|
ios: 'modal.ios.scss',
|
||||||
md: 'modal.md.scss',
|
md: 'modal.md.scss',
|
||||||
wp: 'modal.wp.scss'
|
wp: 'modal.wp.scss'
|
||||||
|
},
|
||||||
|
host: {
|
||||||
|
theme: 'modal'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
export class Modal {
|
export class Modal {
|
||||||
@ -36,7 +39,6 @@ export class Modal {
|
|||||||
@Prop() showBackdrop: boolean = true;
|
@Prop() showBackdrop: boolean = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private animation: Animation;
|
private animation: Animation;
|
||||||
|
|
||||||
@Listen('ionDismiss')
|
@Listen('ionDismiss')
|
||||||
|
|||||||
Reference in New Issue
Block a user