bug fixed

This commit is contained in:
richard-loafle 2020-02-13 14:35:21 +09:00
parent 221974b273
commit ed12c57984

View File

@ -7,7 +7,8 @@ import {
ChangeDetectorRef, ChangeDetectorRef,
ChangeDetectionStrategy, ChangeDetectionStrategy,
ViewChild, ViewChild,
ElementRef ElementRef,
HostListener
} from '@angular/core'; } from '@angular/core';
import { ucapAnimations } from '../../animations'; import { ucapAnimations } from '../../animations';
import { FileEventJson } from '@ucap-webmessenger/protocol-event'; import { FileEventJson } from '@ucap-webmessenger/protocol-event';
@ -54,6 +55,13 @@ export class ImageViewerComponent implements OnInit {
this.naturalHeight = this.fileInfo.imageHeight; this.naturalHeight = this.fileInfo.imageHeight;
} }
@HostListener('window:resize', ['$event'])
onResize(event: Event) {
this.setImageHeight();
this.changeDetectorRef.detectChanges();
}
onClickDownload(): void { onClickDownload(): void {
this.fileDownloadItem = new FileDownloadItem(); this.fileDownloadItem = new FileDownloadItem();
this.download.emit(this.fileDownloadItem); this.download.emit(this.fileDownloadItem);