Skip to content

Commit

Permalink
Refactor #12031
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Nov 7, 2022
1 parent e8c1eec commit 8f9e104
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/app/components/overlay/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
ViewEncapsulation
} from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { OverlayModeType, OverlayOptions, OverlayService, PrimeNGConfig, PrimeTemplate, SharedModule } from 'primeng/api';
import { OverlayModeType, OverlayOptions, OverlayService, PrimeNGConfig, PrimeTemplate, ResponsiveOverlayOptions, SharedModule } from 'primeng/api';
import { ConnectedOverlayScrollHandler, DomHandler } from 'primeng/dom';
import { ZIndexUtils } from 'primeng/utils';

Expand Down Expand Up @@ -170,6 +170,13 @@ export class Overlay implements AfterContentInit, OnDestroy {
this._listener = value;
}

@Input() get responsive(): ResponsiveOverlayOptions | undefined {
return this._responsive || this.overlayOptions?.responsive;
}
set responsive(val: ResponsiveOverlayOptions) {
this._responsive = val;
}

@Input() get options(): OverlayOptions | undefined {
return this._options;
}
Expand Down Expand Up @@ -223,6 +230,8 @@ export class Overlay implements AfterContentInit, OnDestroy {

_listener: any;

_responsive: ResponsiveOverlayOptions | undefined;

_options: OverlayOptions | undefined;

modalVisible: boolean;
Expand Down Expand Up @@ -259,7 +268,7 @@ export class Overlay implements AfterContentInit, OnDestroy {
}

get overlayResponsiveOptions() {
return { ...this.config?.overlayOptions?.responsive, ...this.options?.responsive }; // TODO: Improve performance
return { ...this.overlayOptions?.responsive, ...this.responsive }; // TODO: Improve performance
}

get overlayResponsiveDirection() {
Expand Down

0 comments on commit 8f9e104

Please sign in to comment.