|
|
@@ -99,29 +99,29 @@ export default class ModalFoundation extends BaseFoundation<ModalAdapter> {
|
|
|
this._adapter.toggleHidden(hidden);
|
|
|
};
|
|
|
|
|
|
- // eslint-disable-next-line max-len
|
|
|
- mergeMotionProp = (motion: Motion, prop: string, cb: () => void) => {
|
|
|
- const mergedMotion = typeof (motion) === 'undefined' || motion ? {
|
|
|
- ...(motion as { [key: string]: (() => void) | boolean }),
|
|
|
- [prop]: (...args: any) => {
|
|
|
- const curr = get(motion, prop);
|
|
|
- if (typeof curr === 'function') {
|
|
|
- curr(...args);
|
|
|
- }
|
|
|
- cb();
|
|
|
- }
|
|
|
- } : false;
|
|
|
- return mergedMotion;
|
|
|
- };
|
|
|
-
|
|
|
- getMergedMotion() {
|
|
|
- let { motion } = this._adapter.getProps();
|
|
|
- const { keepDOM } = this._adapter.getProps();
|
|
|
- motion = this.mergeMotionProp(motion, 'didLeave', this.afterClose.bind(this));
|
|
|
- if (!keepDOM) {
|
|
|
- return motion;
|
|
|
- }
|
|
|
- const mergedMotion = this.mergeMotionProp(motion, 'didLeave', this.toggleHidden.bind(this, true));
|
|
|
- return mergedMotion;
|
|
|
- }
|
|
|
+ // // eslint-disable-next-line max-len
|
|
|
+ // mergeMotionProp = (motion: Motion, prop: string, cb: () => void) => {
|
|
|
+ // const mergedMotion = typeof (motion) === 'undefined' || motion ? {
|
|
|
+ // ...(motion as { [key: string]: (() => void) | boolean }),
|
|
|
+ // [prop]: (...args: any) => {
|
|
|
+ // const curr = get(motion, prop);
|
|
|
+ // if (typeof curr === 'function') {
|
|
|
+ // curr(...args);
|
|
|
+ // }
|
|
|
+ // cb();
|
|
|
+ // }
|
|
|
+ // } : false;
|
|
|
+ // return mergedMotion;
|
|
|
+ // };
|
|
|
+ //
|
|
|
+ // getMergedMotion() {
|
|
|
+ // let { motion } = this._adapter.getProps();
|
|
|
+ // const { keepDOM } = this._adapter.getProps();
|
|
|
+ // motion = this.mergeMotionProp(motion, 'didLeave', this.afterClose.bind(this));
|
|
|
+ // if (!keepDOM) {
|
|
|
+ // return motion;
|
|
|
+ // }
|
|
|
+ // const mergedMotion = this.mergeMotionProp(motion, 'didLeave', this.toggleHidden.bind(this, true));
|
|
|
+ // return mergedMotion;
|
|
|
+ // }
|
|
|
}
|