Attempt to simplify the signature of the PDFSidebar constructor, by moving the eventBus parameter from the options object and removing the PDFOutlineViewer dependency

This is similar to the format used by a number of other viewer components, and should simplify the `PDFSidebar` initialization slightly.
Furthermore, by using the `eventBus` it's no longer necessary for `PDFSidebar` to have a direct dependency on `PDFOutlineViewer`.

There's still room for improvement here, but this patch is at least a start (since it's not clear to me how best to handle the viewers).
This commit is contained in:
Jonas Jenwald 2018-10-02 13:08:24 +02:00
parent 3f3ddaf541
commit 8eda8c27f8
3 changed files with 7 additions and 9 deletions

View file

@ -39,6 +39,8 @@ class PDFOutlineViewer {
this.eventBus = eventBus;
this.reset();
eventBus.on('toggleoutlinetree', this.toggleOutlineTree.bind(this));
}
reset() {