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

Refactor PDFFindController to use the 'pagesinit' event, dispatched on the eventBus, to resolve the _firstPagePromise #9861

Conversation

Snuffleupagus
Copy link
Collaborator

Rather than having to manually call a method on PDFFindController instances from BaseViewer.setDocument, thus essentially having to resolve the private _firstPagePromise from the "outside", this can be done easily with the 'pagesinit' event dispatched on the eventBus instead.
Please note this particular PDFFindController code pre-dates the eventBus by almost three years, which should explain why the code looks the way it does.

… on the `eventBus`, to resolve the `_firstPagePromise`

Rather than having to manually call a method on `PDFFindController` instances from `BaseViewer.setDocument`, thus essentially having to resolve the private `_firstPagePromise` from the "outside", this can be done easily with the 'pagesinit' event dispatched on the `eventBus` instead.
Please note this particular `PDFFindController` code pre-dates the `eventBus` by almost three years, which should explain why the code looks the way it does.
@Snuffleupagus
Copy link
Collaborator Author

/botio-windows preview

@pdfjsbot
Copy link

pdfjsbot commented Jul 1, 2018

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/f00c6e3456f1b66/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jul 1, 2018

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/f00c6e3456f1b66/output.txt

Total script time: 4.94 mins

Published

@timvandermeij timvandermeij merged commit 42922c9 into mozilla:master Jul 2, 2018
@timvandermeij
Copy link
Contributor

Good idea to use the event bus here!

@Snuffleupagus Snuffleupagus deleted the PDFFindController-firstPagePromise branch July 2, 2018 21:55
movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
…firstPagePromise

Refactor `PDFFindController` to use the 'pagesinit' event, dispatched on the `eventBus`, to resolve the `_firstPagePromise`
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