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,3 +1,4 @@
import { getIonMode } from '../../../global/ionic-global';
import { Animation, MenuI } from '../../../interface';
import { createAnimation } from '../../animation/animation';
@@ -30,7 +31,8 @@ export const menuOverlayAnimation = (menu: MenuI): Animation => {
.addElement(menu.menuInnerEl!)
.fromTo('transform', `translateX(${closedX})`, `translateX(${openedX})`);
const isIos = menu.mode === 'ios';
const mode = getIonMode(menu);
const isIos = mode === 'ios';
const opacity = isIos ? 0.2 : 0.25;
backdropAnimation

View File

@@ -1,3 +1,4 @@
import { getIonMode } from '../../../global/ionic-global';
import { Animation, MenuI } from '../../../interface';
import { createAnimation } from '../../animation/animation';
@@ -12,6 +13,7 @@ export const menuPushAnimation = (menu: MenuI): Animation => {
let contentOpenedX: string;
let menuClosedX: string;
const mode = getIonMode(menu);
const width = menu.width;
if (menu.isEndSide) {
@@ -35,5 +37,5 @@ export const menuPushAnimation = (menu: MenuI): Animation => {
.addElement(menu.backdropEl!)
.fromTo('opacity', 0.01, 0.32);
return baseAnimation(menu.mode === 'ios').addAnimation([menuAnimation, contentAnimation, backdropAnimation]);
return baseAnimation(mode === 'ios').addAnimation([menuAnimation, contentAnimation, backdropAnimation]);
};

View File

@@ -1,3 +1,4 @@
import { getIonMode } from '../../../global/ionic-global';
import { Animation, MenuI } from '../../../interface';
import { createAnimation } from '../../animation/animation';
@@ -9,11 +10,11 @@ import { baseAnimation } from './base';
* The menu itself, which is under the content, does not move.
*/
export const menuRevealAnimation = (menu: MenuI): Animation => {
const mode = getIonMode(menu);
const openedX = (menu.width * (menu.isEndSide ? -1 : 1)) + 'px';
const contentOpen = createAnimation()
.addElement(menu.contentEl!) // REVIEW
.fromTo('transform', 'translateX(0px)', `translateX(${openedX})`);
return baseAnimation(menu.mode === 'ios').addAnimation(contentOpen);
return baseAnimation(mode === 'ios').addAnimation(contentOpen);
};