Move the sidebar toggleButton event listener into PDFSidebar

This is consistent with other functionality, such as e.g. `SecondaryToolbar` and `PDFFindBar`.
This commit is contained in:
Jonas Jenwald 2019-08-10 15:38:33 +02:00
parent fbe8c6127c
commit 04a3dc65e4
2 changed files with 4 additions and 4 deletions

View File

@ -1654,10 +1654,6 @@ function webViewerInitialized() {
}
}, true);
appConfig.sidebar.toggleButton.addEventListener('click', function() {
PDFViewerApplication.pdfSidebar.toggle();
});
try {
webViewerOpenFileViaURL(file);
} catch (reason) {

View File

@ -390,6 +390,10 @@ class PDFSidebar {
}
});
this.toggleButton.addEventListener('click', () => {
this.toggle();
});
// Buttons for switching views.
this.thumbnailButton.addEventListener('click', () => {
this.switchView(SidebarView.THUMBS);