-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Convert PDFViewer
to an ES6 class
#8636
Convert PDFViewer
to an ES6 class
#8636
Conversation
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.
Nice work! Good to merge with the comments addressed.
web/pdf_viewer.js
Outdated
} | ||
if (!(0 < val && val <= this.pagesCount)) { | ||
console.error( | ||
'PDFViewer._setCurrentPageNumber: "${val}" is out of bounds.'); |
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.
This whole string should be in backticks instead of regular quotes to actually evaluate the template literal "${val}"
.
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.
D'oh, this is embarrassing!
Thank you for spotting this; and as usual thanks for the review!
web/pdf_viewer.js
Outdated
console.error('PDFViewer_scrollPageIntoView: \'' + dest[1].name + | ||
'\' is not a valid destination type.'); | ||
console.error( | ||
'PDFViewer._setScale: "${value}" is an unknown zoom value.'); |
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.
This whole string should be in backticks instead of regular quotes to actually evaluate the template literal "${value}"
.
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.
D'oh, this is embarrassing!
Thank you for spotting this; and as usual thanks for the review!
…nto `PDFViewer` instead Since the method needs to access properties that are directly available inside of `PDFViewer`, it seems simpler to just have it live there.
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/844bd6b6bb59897/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/844bd6b6bb59897/output.txt Total script time: 2.40 mins Published |
Convert `PDFViewer` to an ES6 class
Much more managable diff with https://github.com/mozilla/pdf.js/pull/8636/files?w=1.