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

Adding checks for changed scale prop in src/Pdf.js to zoom dynamically #3

Merged
merged 3 commits into from
Jan 14, 2016
Merged

Adding checks for changed scale prop in src/Pdf.js to zoom dynamically #3

merged 3 commits into from
Jan 14, 2016

Conversation

boristian
Copy link
Contributor

Hi,

for a project i'm working on I needed the ability to zoom pdfs. Since you only check for newProps.pagein https://github.com/erikras/react-pdfjs/blob/master/src/Pdf.js#l27 i've added checks for changed scale prop. It would be great if you could merge it.

Also thanks to the original author, @nnarhinen.

@@ -9,10 +9,9 @@ class Pdf extends Component {
super(props);
this.onDocumentComplete = this.onDocumentComplete.bind(this);
this.onPageComplete = this.onPageComplete.bind(this);
this.state = {};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why move this to constructor? It was fine where it was.

@boristian
Copy link
Contributor Author

On my machine, running node v5.3.0., this led to an Unexpected token error. After moving the statement to the constructor it was fine.

@boristian
Copy link
Contributor Author

Hi,
if the moved state declaration is the problem why the PR is not merged, i can move it back. But i cannot test it that way.

@erikras erikras merged commit 9d58162 into erikras:master Jan 14, 2016
@erikras
Copy link
Owner

erikras commented Jan 14, 2016

Published to v1.0.6. Thanks!

@boristian
Copy link
Contributor Author

Thank you for merging. 👍

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.

2 participants