mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-4424] Pdf Viewer - password dialog does not close when pressing Escape (#4622)
* return to previous page on close * update e2e * [ADF-4424] Improve PreviousRouteService to use it in pdfViewer * change previous Url logic * remove navigation logic * remove test * Update pdfViewer.component.spec.ts * back button logic for viewer outlet * unit tests * remove fdescribe * remove unused service * e2e * return to location * remove click filter step * remove unnecessary test steps * remove un existen export * unify preview between PS and CS in demo shell * fix dispalyname property
This commit is contained in:
committed by
Eugenio Romano
parent
72b3a75a85
commit
ccdcba8778
@@ -79,6 +79,9 @@ export class PdfViewerComponent implements OnChanges, OnDestroy {
|
||||
@Output()
|
||||
error = new EventEmitter<any>();
|
||||
|
||||
@Output()
|
||||
close = new EventEmitter<any>();
|
||||
|
||||
loadingTask: any;
|
||||
currentPdfDocument: any;
|
||||
page: number;
|
||||
@@ -188,11 +191,11 @@ export class PdfViewerComponent implements OnChanges, OnDestroy {
|
||||
|
||||
this.currentPdfDocument.getPage(1).then(() => {
|
||||
this.scalePage('auto');
|
||||
}, (error) => {
|
||||
}, () => {
|
||||
this.error.emit();
|
||||
});
|
||||
|
||||
}, (error) => {
|
||||
}, () => {
|
||||
this.error.emit();
|
||||
});
|
||||
}
|
||||
@@ -461,13 +464,14 @@ export class PdfViewerComponent implements OnChanges, OnDestroy {
|
||||
this.dialog
|
||||
.open(PdfPasswordDialogComponent, {
|
||||
width: '400px',
|
||||
disableClose: true,
|
||||
data: { reason }
|
||||
})
|
||||
.afterClosed().subscribe((password) => {
|
||||
if (password) {
|
||||
callback(password);
|
||||
}
|
||||
if (password) {
|
||||
callback(password);
|
||||
} else {
|
||||
this.close.emit();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user