Skip to content
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

Merged
merged 29 commits into from
Feb 19, 2019
Merged

Conversation

ConradJChan
Copy link
Contributor

@ConradJChan ConradJChan commented Feb 19, 2019

Now supports the thumbnails sidebar for document types.

Click the toggle button to open and close the sidebar
screen shot 2019-02-19 at 10 59 54 am

screen shot 2019-02-19 at 10 56 01 am

Conrad Chan and others added 28 commits February 19, 2019 10:43
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
@boxcla
Copy link

boxcla commented Feb 19, 2019

Verified that @ConradJChan has signed the CLA. Thanks for the pull request!

@ConradJChan ConradJChan merged commit 4d3ecc3 into box:master Feb 19, 2019
@ConradJChan ConradJChan deleted the merge-thumbnails branch February 19, 2019 21:17

this.maxEntries = maxEntries || 500;
this.cache = {};
this.cacheQueue = [];
Copy link
Contributor

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 ||

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants