mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
bug fix
This commit is contained in:
@@ -96,7 +96,13 @@
|
||||
customElements.define('page-two', PageTwo);
|
||||
customElements.define('page-three', PageThree);
|
||||
|
||||
window.Ionic.config.navAnimation = (AnimationC, navEl, opts) => {
|
||||
|
||||
/*window.Ionic.config.navAnimation = (AnimationC, navEl, opts) => {
|
||||
|
||||
const shadow = (el) => {
|
||||
return el.shadowRoot || el;
|
||||
};
|
||||
|
||||
const DURATION = 540;
|
||||
const EASING = 'cubic-bezier(0.32,0.72,0,1)';
|
||||
const OPACITY = 'opacity';
|
||||
@@ -388,7 +394,7 @@
|
||||
|
||||
// Return the rootTransition promise
|
||||
return Promise.resolve(rootTransition);
|
||||
};
|
||||
};*/
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ export const createAnimation = (): Animation => {
|
||||
let _duration: number | undefined;
|
||||
let _easing: string | undefined;
|
||||
let _iterations: number | undefined;
|
||||
let _fill: 'auto' | 'none' | 'forwards' | 'backwards' | 'both' | undefined = 'forwards';
|
||||
let _fill: 'auto' | 'none' | 'forwards' | 'backwards' | 'both' | undefined;
|
||||
let _direction: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse' | undefined;
|
||||
let _keyframes: any[] = [];
|
||||
|
||||
|
||||
@@ -195,6 +195,9 @@ const overlayAnimation = async (
|
||||
isAnimationBuilder = true;
|
||||
} catch (err) {
|
||||
animation = animationBuilder(aniRoot, opts);
|
||||
|
||||
// TODO: Clean up
|
||||
animation.fill('both');
|
||||
}
|
||||
|
||||
overlay.animation = animation;
|
||||
|
||||
@@ -84,12 +84,11 @@ const animation = async (animationBuilder: IonicAnimation | AnimationBuilder, op
|
||||
* TODO: Remove AnimationBuilder
|
||||
*/
|
||||
let trans;
|
||||
// let isAnimationBuilder = false;
|
||||
try {
|
||||
trans = await import('../animation/old-animation').then(mod => mod.create(animationBuilder as any, opts.baseEl, opts));
|
||||
|
||||
// isAnimationBuilder = true;
|
||||
} catch (err) {
|
||||
// @ts-ignore
|
||||
// TODO: Fix this type error
|
||||
trans = animationBuilder(opts.baseEl, opts);
|
||||
}
|
||||
|
||||
@@ -97,18 +96,18 @@ const animation = async (animationBuilder: IonicAnimation | AnimationBuilder, op
|
||||
|
||||
const didComplete = await playTransition(trans, opts);
|
||||
|
||||
trans.hasCompleted = didComplete;
|
||||
(trans as any).hasCompleted = didComplete;
|
||||
|
||||
if (opts.progressCallback) {
|
||||
opts.progressCallback(undefined);
|
||||
}
|
||||
|
||||
if (trans.hasCompleted) {
|
||||
if ((trans as any).hasCompleted) {
|
||||
fireDidEvents(opts.enteringEl, opts.leavingEl);
|
||||
}
|
||||
|
||||
return {
|
||||
hasCompleted: trans.hasCompleted,
|
||||
hasCompleted: (trans as any).hasCompleted,
|
||||
animation: trans
|
||||
};
|
||||
};
|
||||
@@ -248,5 +247,5 @@ export interface TransitionOptions extends NavOptions {
|
||||
|
||||
export interface TransitionResult {
|
||||
hasCompleted: boolean;
|
||||
animation?: Animation;
|
||||
animation?: Animation | IonicAnimation;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user