mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Change the getVisibleElements
helper function to take a parameter object
Given the number of parameters, and the fact that many of them are booleans, the call-sites are no longer particularly easy to read and understand. Furthermore, this slightly improves the formatting of the JSDoc-comment, since it needed updating as part of these changes anyway. Finally, this removes an unnecessary `numViews === 0` check from `getVisibleElements`, since that should be *very* rare and more importantly that the `binarySearchFirstItem` function already has a fast-path for that particular case.
This commit is contained in:
parent
4e13559cb0
commit
ba761e42f0
4 changed files with 55 additions and 41 deletions
|
@ -81,7 +81,10 @@ class PDFThumbnailViewer {
|
|||
* @private
|
||||
*/
|
||||
_getVisibleThumbs() {
|
||||
return getVisibleElements(this.container, this._thumbnails);
|
||||
return getVisibleElements({
|
||||
scrollEl: this.container,
|
||||
views: this._thumbnails,
|
||||
});
|
||||
}
|
||||
|
||||
scrollThumbnailIntoView(pageNumber) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue