Skip to content

Commit

Permalink
Refactor #3965 - Refactor on Dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Jul 5, 2023
1 parent 3014b22 commit e65a1ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
19 changes: 12 additions & 7 deletions components/lib/dialog/BaseDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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',
{
Expand Down
6 changes: 0 additions & 6 deletions components/lib/dialog/Dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down

0 comments on commit e65a1ee

Please sign in to comment.