Call the reset() methods in the PDFAttachmentViewer and PDFOutlineViewer constructors

Rather than duplicating initialization code, we can just call `this.reset()` instead (which is also similar to other existing code, e.g. `PDFViewer`). This will also help ensure that the DOM is completely reset, before any outline items or attachments are displayed.
This commit is contained in:
Jonas Jenwald 2017-08-14 12:34:24 +02:00
parent 3a017b4317
commit 96fb0c0370
2 changed files with 4 additions and 6 deletions

View file

@ -36,12 +36,11 @@ class PDFOutlineViewer {
* @param {PDFOutlineViewerOptions} options
*/
constructor({ container, linkService, eventBus, }) {
this.outline = null;
this.lastToggleIsShow = true;
this.container = container;
this.linkService = linkService;
this.eventBus = eventBus;
this.reset();
}
reset() {