From ed12c57984a6fe45c47f445fef6f504c2c974b33 Mon Sep 17 00:00:00 2001 From: richard-loafle <44828666+richard-loafle@users.noreply.github.com> Date: Thu, 13 Feb 2020 14:35:21 +0900 Subject: [PATCH] bug fixed --- .../components/file-viewer/image-viewer.component.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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);