41 lines
942 B
TypeScript
41 lines
942 B
TypeScript
import {
|
|
Component,
|
|
EventEmitter,
|
|
HostListener,
|
|
Input,
|
|
OnInit,
|
|
Output,
|
|
} from '@angular/core';
|
|
import { OverlayService } from '../../../services/overlay.service';
|
|
import { CommonModule } from '@angular/common';
|
|
|
|
@Component({
|
|
selector: 'app-overlay',
|
|
standalone: true,
|
|
imports: [CommonModule],
|
|
templateUrl: './overlay.component.html',
|
|
styleUrl: './overlay.component.scss',
|
|
})
|
|
export class OverlayComponent implements OnInit {
|
|
overlayData: any;
|
|
|
|
constructor(private overlayService: OverlayService) {}
|
|
|
|
ngOnInit(): void {
|
|
this.overlayService.overlayData$.subscribe((data) => {
|
|
this.overlayData = data;
|
|
});
|
|
}
|
|
|
|
onCloseOverlay() {
|
|
this.overlayData = '';
|
|
}
|
|
|
|
@HostListener('document:click', ['$event'])
|
|
checkOpenContactEdit(event: MouseEvent) {
|
|
const targetElement = event.target as HTMLElement;
|
|
if (targetElement.closest('.overlay-content')) {
|
|
this.onCloseOverlay();
|
|
}
|
|
}
|
|
}
|