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

Add a |textlayerrendered| event #5606

Merged
merged 1 commit into from
Jan 6, 2015
Merged

Add a |textlayerrendered| event #5606

merged 1 commit into from
Jan 6, 2015

Conversation

Snuffleupagus
Copy link
Collaborator

Tentative patch, implementing #5511 (comment).

event.initCustomEvent('textlayerrendered', true, true, {
pageNumber: pageView.id
});
self.container.dispatchEvent(event);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can move event dispatching to the text_layer_builder.js (and avoid callback stuff)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not opposed to implementing this the way you describe (should be fewer lines of code).

The reason that I didn't do so, is that the pagerendered event is placed in pdf_viewer.js and not in pdf_page_view.js. Hence I figured that for the sake of consistency, textlayerrendered should be implemented similarly.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, shall we move pagerendered event too? :)

@yurydelendik
Copy link
Contributor

/botio-windows preview

@pdfjsbot
Copy link

pdfjsbot commented Jan 6, 2015

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/d977fff080de8f6/output.txt

@@ -53,6 +54,17 @@ var TextLayerBuilder = (function TextLayerBuilderClosure() {
}

TextLayerBuilder.prototype = {
_afterRender: function TextLayerBuilder_afterRender() {
if (!this.renderingDone) {
Copy link
Contributor

Choose a reason for hiding this comment

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

you can remove this. or make it 'finishRendering' and assign this.renderingDone = true; here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed; I went for the _finishRendering option since that meant less code duplication.

@Snuffleupagus
Copy link
Collaborator Author

/botio-windows preview

@pdfjsbot
Copy link

pdfjsbot commented Jan 6, 2015

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/808f43fd5c1bb21/output.txt

yurydelendik added a commit that referenced this pull request Jan 6, 2015
@yurydelendik yurydelendik merged commit 039c7b4 into mozilla:master Jan 6, 2015
@yurydelendik
Copy link
Contributor

Thank you

@Snuffleupagus Snuffleupagus deleted the textlayerrendered branch January 6, 2015 20:43
speedplane pushed a commit to speedplane/pdf.js that referenced this pull request Feb 24, 2015
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