fixed ngzone for open aswell

This commit is contained in:
Timo Bejan 2020-10-21 17:49:50 +03:00
parent 37e484b6db
commit 30c112b743
2 changed files with 6 additions and 16 deletions

View File

@ -149,6 +149,4 @@
</button>
</section>
<button class="hidden" (click)="openManualRedactionDialog()" id="open-manual-redaction-dialog-btn"></button>
<redaction-full-page-loading-indicator [displayed]="!viewReady"></redaction-full-page-loading-indicator>

View File

@ -37,7 +37,6 @@ export class FilePreviewScreenComponent implements OnInit {
private _readyViewers: string[] = [];
private projectId: string;
private _activeViewer: 'ANNOTATED' | 'REDACTED' = 'ANNOTATED';
private _manualRedactionEntry: AddRedactionRequest;
@ViewChild(PdfViewerComponent) private _viewerComponent: PdfViewerComponent;
@ViewChild('annotations') private _annotationsElement: ElementRef;
@ -167,19 +166,12 @@ export class FilePreviewScreenComponent implements OnInit {
}
handleManualAnnotationRequest($event: ManualRedactionEntry) {
this._manualRedactionEntry = $event;
document.getElementById('open-manual-redaction-dialog-btn').click();
}
openManualRedactionDialog() {
const ref = this._dialog.open(ManualRedactionDialogComponent, {
width: '600px',
maxWidth: '90vw',
data: this._manualRedactionEntry
});
ref.afterClosed().subscribe(() => {
this._manualRedactionEntry = null;
this.ngZone.run(() => {
this._dialog.open(ManualRedactionDialogComponent, {
width: '600px',
maxWidth: '90vw',
data: $event
});
});
}