diff --git a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/image-viewer.component.ts b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/image-viewer.component.ts index 2a4bf9f3..4324e3ef 100644 --- a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/image-viewer.component.ts +++ b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/image-viewer.component.ts @@ -7,7 +7,8 @@ import { ChangeDetectorRef, ChangeDetectionStrategy, ViewChild, - ElementRef + ElementRef, + HostListener } from '@angular/core'; import { ucapAnimations } from '../../animations'; import { FileEventJson } from '@ucap-webmessenger/protocol-event'; @@ -54,6 +55,13 @@ export class ImageViewerComponent implements OnInit { this.naturalHeight = this.fileInfo.imageHeight; } + @HostListener('window:resize', ['$event']) + onResize(event: Event) { + this.setImageHeight(); + + this.changeDetectorRef.detectChanges(); + } + onClickDownload(): void { this.fileDownloadItem = new FileDownloadItem(); this.download.emit(this.fileDownloadItem);