refactor(): minor updates for next stencil version (#20787)

This commit is contained in:
Manu MA
2020-03-24 16:59:07 +01:00
committed by GitHub
parent 7a4ddde5ce
commit 976e68da5b
38 changed files with 6825 additions and 6862 deletions

View File

@ -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') {