Reset the IPDFLinkService.externalLinkEnabled property on document closing

Given that this property is only used with password protected documents, and is consequently document-specific rather than viewer-specific, ensure that `IPDFLinkService.externalLinkEnabled` is actually being reset by `PDFViewerApplication.close`.

To make things less confusing/inconsistent, remove the *undocumented* `externalLinkEnabled` property from the `PDFLinkService` constructor and force it to always be manually set when needed.
This commit is contained in:
Jonas Jenwald 2021-06-23 14:00:54 +02:00
parent 9441245320
commit d959cb824d
2 changed files with 2 additions and 2 deletions

View File

@ -828,6 +828,7 @@ const PDFViewerApplication = {
this.pdfDocumentProperties.setDocument(null);
}
webViewerResetPermissions();
this.pdfLinkService.externalLinkEnabled = true;
this._fellback = false;
this.store = null;
this.isInitialViewSet = false;

View File

@ -41,13 +41,12 @@ class PDFLinkService {
eventBus,
externalLinkTarget = null,
externalLinkRel = null,
externalLinkEnabled = true,
ignoreDestinationZoom = false,
} = {}) {
this.eventBus = eventBus;
this.externalLinkTarget = externalLinkTarget;
this.externalLinkRel = externalLinkRel;
this.externalLinkEnabled = externalLinkEnabled;
this.externalLinkEnabled = true;
this._ignoreDestinationZoom = ignoreDestinationZoom;
this.baseUrl = null;