mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Remove the view
-specific getters in the PDFSidebar
class
With the exception of `isThumbnailViewVisible`, these getters are completely unused. Generally speaking, using the `visibleView`-getter directly works just as well and seems (at least to me) to be overall preferable considering how our classes are usually implemented.
This commit is contained in:
parent
e6a0a953e8
commit
13fda7caeb
2 changed files with 8 additions and 26 deletions
|
@ -120,22 +120,6 @@ class PDFSidebar {
|
|||
return this.isOpen ? this.active : SidebarView.NONE;
|
||||
}
|
||||
|
||||
get isThumbnailViewVisible() {
|
||||
return this.isOpen && this.active === SidebarView.THUMBS;
|
||||
}
|
||||
|
||||
get isOutlineViewVisible() {
|
||||
return this.isOpen && this.active === SidebarView.OUTLINE;
|
||||
}
|
||||
|
||||
get isAttachmentsViewVisible() {
|
||||
return this.isOpen && this.active === SidebarView.ATTACHMENTS;
|
||||
}
|
||||
|
||||
get isLayersViewVisible() {
|
||||
return this.isOpen && this.active === SidebarView.LAYERS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} view - The sidebar view that should become visible,
|
||||
* must be one of the values in {SidebarView}.
|
||||
|
@ -447,7 +431,7 @@ class PDFSidebar {
|
|||
this.eventBus._on("presentationmodechanged", evt => {
|
||||
if (
|
||||
evt.state === PresentationModeState.NORMAL &&
|
||||
this.isThumbnailViewVisible
|
||||
this.visibleView === SidebarView.THUMBS
|
||||
) {
|
||||
this._updateThumbnailViewer();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue