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

Convert PDFViewer to an ES6 class #8636

Merged
merged 2 commits into from
Jul 16, 2017
Merged

Convert PDFViewer to an ES6 class #8636

merged 2 commits into from
Jul 16, 2017

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Jul 11, 2017

Copy link
Contributor

@timvandermeij timvandermeij left a 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.

}
if (!(0 < val && val <= this.pagesCount)) {
console.error(
'PDFViewer._setCurrentPageNumber: "${val}" is out of bounds.');
Copy link
Contributor

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}".

Copy link
Collaborator Author

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!

console.error('PDFViewer_scrollPageIntoView: \'' + dest[1].name +
'\' is not a valid destination type.');
console.error(
'PDFViewer._setScale: "${value}" is an unknown zoom value.');
Copy link
Contributor

@timvandermeij timvandermeij Jul 15, 2017

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}".

Copy link
Collaborator Author

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.
@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/844bd6b6bb59897/output.txt

@mozilla mozilla deleted a comment from pdfjsbot Jul 16, 2017
@mozilla mozilla deleted a comment from pdfjsbot Jul 16, 2017
@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/844bd6b6bb59897/output.txt

Total script time: 2.40 mins

Published

@Snuffleupagus Snuffleupagus merged commit 5187f0f into mozilla:master Jul 16, 2017
@Snuffleupagus Snuffleupagus deleted the es6-PDFViewer-class branch July 16, 2017 13:58
movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants