mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
refactor(): minor updates for next stencil version (#20787)
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { config } from '../global/config';
|
||||
import { getIonMode } from '../global/ionic-global';
|
||||
import { ActionSheetOptions, AlertOptions, Animation, AnimationBuilder, BackButtonEvent, HTMLIonOverlayElement, IonicConfig, LoadingOptions, ModalOptions, OverlayInterface, PickerOptions, PopoverOptions, ToastOptions } from '../interface';
|
||||
|
||||
import { OVERLAY_BACK_BUTTON_PRIORITY } from './hardware-back-button';
|
||||
@ -128,10 +129,11 @@ export const present = async (
|
||||
overlay.presented = true;
|
||||
overlay.willPresent.emit();
|
||||
|
||||
const mode = getIonMode(overlay);
|
||||
// get the user's animation fn if one was provided
|
||||
const animationBuilder = (overlay.enterAnimation)
|
||||
? overlay.enterAnimation
|
||||
: config.get(name, overlay.mode === 'ios' ? iosEnterAnimation : mdEnterAnimation);
|
||||
: config.get(name, mode === 'ios' ? iosEnterAnimation : mdEnterAnimation);
|
||||
|
||||
const completed = await overlayAnimation(overlay, animationBuilder, overlay.el, opts);
|
||||
if (completed) {
|
||||
@ -155,10 +157,10 @@ export const dismiss = async (
|
||||
|
||||
try {
|
||||
overlay.willDismiss.emit({ data, role });
|
||||
|
||||
const mode = getIonMode(overlay);
|
||||
const animationBuilder = (overlay.leaveAnimation)
|
||||
? overlay.leaveAnimation
|
||||
: config.get(name, overlay.mode === 'ios' ? iosLeaveAnimation : mdLeaveAnimation);
|
||||
: config.get(name, mode === 'ios' ? iosLeaveAnimation : mdLeaveAnimation);
|
||||
|
||||
// If dismissed via gesture, no need to play leaving animation again
|
||||
if (role !== 'gesture') {
|
||||
|
Reference in New Issue
Block a user