fix(overlay): cssClasses applied to overlay

This commit is contained in:
Manu Mtz.-Almeida
2018-04-17 18:58:28 +02:00
parent 099b3edda3
commit 43d7538e66
2 changed files with 7 additions and 13 deletions

View File

@ -1,7 +1,7 @@
import { Component, Element, Event, EventEmitter, Listen, Method, Prop } from '@stencil/core';
import { Animation, AnimationBuilder, ComponentProps, ComponentRef, Config, FrameworkDelegate } from '../../index';
import { createThemedClasses, getClassList } from '../../utils/theme';
import { createThemedClasses, getClassMap } from '../../utils/theme';
import { BACKDROP, OverlayEventDetail, OverlayInterface, dismiss, eventMethod, present } from '../../utils/overlays';
import { attachComponent, detachComponent } from '../../utils/framework-delegate';
@ -176,11 +176,7 @@ export class Modal implements OverlayInterface {
...this.componentProps,
modal: this.el
};
const classes = [
...getClassList(this.cssClass),
'ion-page'
];
this.usersElement = await attachComponent(this.delegate, container, this.component, classes, componentProps);
this.usersElement = await attachComponent(this.delegate, container, this.component, ['ion-page'], componentProps);
return present(this, 'modalEnter', iosEnterAnimation, mdEnterAnimation);
}
@ -222,6 +218,7 @@ export class Modal implements OverlayInterface {
hostData() {
return {
'no-router': true,
class: getClassMap(this.cssClass),
style: {
zIndex: 20000 + this.overlayId,
}

View File

@ -1,7 +1,7 @@
import { Component, Element, Event, EventEmitter, Listen, Method, Prop } from '@stencil/core';
import { Animation, AnimationBuilder, ComponentProps, ComponentRef, Config, FrameworkDelegate } from '../../index';
import { createThemedClasses, getClassList } from '../../utils/theme';
import { createThemedClasses, getClassMap } from '../../utils/theme';
import { BACKDROP, OverlayEventDetail, OverlayInterface, dismiss, eventMethod, present } from '../../utils/overlays';
import { attachComponent, detachComponent } from '../../utils/framework-delegate';
@ -186,11 +186,7 @@ export class Popover implements OverlayInterface {
...this.componentProps,
popover: this.el
};
const classes = [
...getClassList(this.cssClass),
'popover-viewport'
];
this.usersElement = await attachComponent(this.delegate, container, this.component, classes, data);
this.usersElement = await attachComponent(this.delegate, container, this.component, ['popover-viewport'], data);
return present(this, 'popoverEnter', iosEnterAnimation, mdEnterAnimation, this.ev);
}
@ -238,7 +234,8 @@ export class Popover implements OverlayInterface {
},
'no-router': true,
class: {
...themedClasses
...themedClasses,
...getClassMap(this.cssClass),
}
};
}