Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #12031 - Component: Responsive Overlay #12044

Merged
merged 2 commits into from
Oct 21, 2022
Merged

Fixed #12031 - Component: Responsive Overlay #12044

merged 2 commits into from
Oct 21, 2022

Conversation

cetincakiroglu
Copy link
Contributor

@cetincakiroglu cetincakiroglu commented Oct 13, 2022

New component: p-overlay

@github-actions
Copy link

👋 Hi,
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

@cetincakiroglu cetincakiroglu linked an issue Oct 13, 2022 that may be closed by this pull request
6 tasks
@github-actions
Copy link

👋 Hi,
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

@github-actions github-actions bot added the Resolution: Needs Revision The pull request can't be merged. Conflicts need to be corrected or documentation and code updated. label Oct 13, 2022
@Component({
selector: 'p-overlay',
template: `
<div #overlay [ngClass]="panelClass" [class]="panelStyleClass" [ngStyle]="panelStyle" [@overlayAnimation]="{value: 'visible', params: {transform: transformOptions, showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}" (click)="onOverlayClick($event)" (click)="onOverlayClick($event)">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate event handler in template

(click)="onOverlayClick($event)"

const viewport = DomHandler.getViewport();
if (value && viewport.width < this.overlayBreakpoints) {
this._overlayDirection = value;
switch (value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, mb create private method for that.

this. transformOptions = this.method(value);

//
private method(value: string): string {
        switch (value) {
            case 'start':
                return 'translate3d(0px, -100%, 0px)';
            case 'end':
                return 'translate3d(0px, 100%, 0px)';
            case 'center':
                return 'scale(0.8)';
        }
    }


if(this.overlayViewChild) {
if (viewport.width < this.overlayBreakpoints) {
switch (this.overlayDirection) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also mb create method

DomHandler.addClass(this.el.nativeElement, this.getOverlayDirection(this.overlayDirection))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @volvachev

Thanks for your feedback, it's not the production version of the code it'll be updated and refactored before release.

@github-actions
Copy link

👋 Hi,
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

@mertsincan mertsincan merged commit 8c9caa8 into master Oct 21, 2022
@mertsincan mertsincan deleted the issue-12031 branch October 26, 2022 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Needs Revision The pull request can't be merged. Conflicts need to be corrected or documentation and code updated.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Component: Overlay
3 participants