-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New: Thumbnails Sidebar #932
Conversation
Now cuts thumbnail images to insert into sidebar. Current approach as to *when* to render thumbnail images is to introduce a `onScrollEnd` callback from the `VirtualScroller` so that when scrolling ends, we look at what list items are rendered and then ask PDFJS to generate the thumbnail image. The `VirtualScroller` `renderItemFn` is invoked by a throttled scroll event handler which is used to create a placeholder thumbnail which includes the page number indicator
Handle the click events on the thumbnail elements in order to navigate to that page of the document
Also fixes an issue where elements that request fullscreen in Safari do not get their width set appropriately if it is a flex item in a flex container
Verified that @ConradJChan has signed the CLA. Thanks for the pull request! |
|
||
this.maxEntries = maxEntries || 500; | ||
this.cache = {}; | ||
this.cacheQueue = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could initialize cacheQueue
as a class field, above the constructor.
No need to set this.cache
since that will happen in the super
call
Also, give a default value to maxEntries
parameter, then you can remove the ||
Now supports the thumbnails sidebar for document types.
Click the toggle button to open and close the sidebar