mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
[api-minor] Change {PDFPageView, PDFThumbnailView}.update
to take a parameter object
The old `update`-signature started to annoy me back when I added optional content support to the viewer, since we're (often) forced to pass in a bunch of arguments that we don't care about whenever these methods are called. This is tagged `api-minor` since `PDFPageView` is being used in the `pageviewer` component example, and it's thus possible that these changes could affect some users; the next commit adds fallback handling for the old format.
This commit is contained in:
parent
258cf1decc
commit
7c81a8dd40
4 changed files with 17 additions and 15 deletions
|
@ -144,8 +144,9 @@ class PDFThumbnailViewer {
|
|||
}
|
||||
this._pagesRotation = rotation;
|
||||
|
||||
for (let i = 0, ii = this._thumbnails.length; i < ii; i++) {
|
||||
this._thumbnails[i].update(rotation);
|
||||
const updateArgs = { rotation };
|
||||
for (const thumbnail of this._thumbnails) {
|
||||
thumbnail.update(updateArgs);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue