mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
refactor(): minor updates for next stencil version (#20787)
This commit is contained in:
@ -2,7 +2,6 @@ import { Animation, Side } from '../../interface';
|
||||
|
||||
export interface MenuI {
|
||||
el: HTMLIonMenuElement;
|
||||
mode: string;
|
||||
side: Side;
|
||||
menuId?: string;
|
||||
disabled: boolean;
|
||||
|
||||
@ -28,11 +28,6 @@ export class Menu implements ComponentInterface, MenuI {
|
||||
private gesture?: Gesture;
|
||||
private blocker = GESTURE_CONTROLLER.createBlocker({ disableScroll: true });
|
||||
|
||||
mode = getIonMode(this);
|
||||
|
||||
private easing: string = this.mode === 'ios' ? iosEasing : mdEasing;
|
||||
private easingReverse: string = this.mode === 'ios' ? iosEasingReverse : mdEasingReverse;
|
||||
|
||||
isAnimating = false;
|
||||
width!: number; // TODO
|
||||
_isOpen = false;
|
||||
@ -335,9 +330,12 @@ AFTER:
|
||||
|
||||
private async startAnimation(shouldOpen: boolean, animated: boolean): Promise<void> {
|
||||
const isReversed = !shouldOpen;
|
||||
const mode = getIonMode(this);
|
||||
const easing = mode === 'ios' ? iosEasing : mdEasing;
|
||||
const easingReverse = mode === 'ios' ? iosEasingReverse : mdEasingReverse;
|
||||
const ani = (this.animation as Animation)!
|
||||
.direction((isReversed) ? 'reverse' : 'normal')
|
||||
.easing((isReversed) ? this.easingReverse : this.easing)
|
||||
.easing((isReversed) ? easingReverse : easing)
|
||||
.onFinish(() => {
|
||||
if (ani.getDirection() === 'reverse') {
|
||||
ani.direction('normal');
|
||||
@ -554,7 +552,8 @@ AFTER:
|
||||
}
|
||||
|
||||
render() {
|
||||
const { isEndSide, type, disabled, mode, isPaneVisible } = this;
|
||||
const { isEndSide, type, disabled, isPaneVisible } = this;
|
||||
const mode = getIonMode(this);
|
||||
|
||||
return (
|
||||
<Host
|
||||
|
||||
Reference in New Issue
Block a user