-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Conversation
👋 Hi, |
👋 Hi, |
@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)"> |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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))
There was a problem hiding this comment.
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.
👋 Hi, |
New component: p-overlay