Add a reset method to the PDFHistory implementation

This patch addresses a couple of smaller issues with the `PDFHistory` class:
 - Most, if not all, other viewer components can be reset in one way or another, and there's no good reason for the `PDFHistory` implementation to be different here.

 - Currently it's (technically) possible to keep adding entries to the browser history, via the `PDFHistory` instance, even after the document has been closed. That obviously makes no sense, and is caused by the lack of a `reset` method.

 - The internal `this._isPagesLoaded` property was never actually reset, which would lead to it being temporarily wrong when a new document was opened in the default viewer.
This commit is contained in:
Jonas Jenwald 2019-12-03 12:04:49 +01:00
parent 903bf177cb
commit d621899d50
4 changed files with 109 additions and 47 deletions

View file

@ -130,6 +130,10 @@ var PDFViewerApplication = {
this.pdfViewer.setDocument(null);
this.pdfLinkService.setDocument(null, null);
if (this.pdfHistory) {
this.pdfHistory.reset();
}
}
return promise;