Refactor #3965 - Refactor on Dialog
parent
3014b22550
commit
e65a1ee1d4
|
@ -160,13 +160,18 @@ const inlineStyles = {
|
|||
};
|
||||
|
||||
const classes = {
|
||||
mask: ({ props, instance }) => [
|
||||
'p-dialog-mask',
|
||||
{
|
||||
'p-component-overlay p-component-overlay-enter': props.modal
|
||||
},
|
||||
instance.getPositionClass()
|
||||
],
|
||||
mask: ({ props }) => {
|
||||
const positions = ['left', 'right', 'top', 'topleft', 'topright', 'bottom', 'bottomleft', 'bottomright'];
|
||||
const pos = positions.find((item) => item === props.position);
|
||||
|
||||
return [
|
||||
'p-dialog-mask',
|
||||
{
|
||||
'p-component-overlay p-component-overlay-enter': props.modal
|
||||
},
|
||||
pos ? `p-dialog-${pos}` : ''
|
||||
];
|
||||
},
|
||||
root: ({ props, instance }) => [
|
||||
'p-dialog p-component',
|
||||
{
|
||||
|
|
|
@ -222,12 +222,6 @@ export default {
|
|||
this.documentKeydownListener = null;
|
||||
}
|
||||
},
|
||||
getPositionClass() {
|
||||
const positions = ['left', 'right', 'top', 'topleft', 'topright', 'bottom', 'bottomleft', 'bottomright'];
|
||||
const pos = positions.find((item) => item === this.position);
|
||||
|
||||
return pos ? `p-dialog-${pos}` : '';
|
||||
},
|
||||
containerRef(el) {
|
||||
this.container = el;
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue