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

Prevent the annotationLayer from being recreated when the page is redrawn #4552

Merged
merged 1 commit into from Apr 16, 2014
Merged

Conversation

ghost
Copy link

@ghost ghost commented Apr 1, 2014

This allows interactive annotations (current and future) to keep their states after a resize

@ghost
Copy link
Author

ghost commented Apr 2, 2014

@Snuffleupagus: Done

@Snuffleupagus
Copy link
Collaborator

/botio-windows preview

@pdfjsbot
Copy link

pdfjsbot commented Apr 2, 2014

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/9eb9cad7a34d0b9/output.txt

@timvandermeij
Copy link
Contributor

@dferer Could you rebase this PR?

@ghost
Copy link
Author

ghost commented Apr 11, 2014

@timvandermeij Done

@Snuffleupagus Snuffleupagus self-assigned this Apr 15, 2014
var annotationLayerDiv = document.createElement('div');
annotationLayerDiv.className = 'annotationLayer';
pageDiv.appendChild(annotationLayerDiv);
self.annotationLayer = annotationLayerDiv;
Copy link
Collaborator

Choose a reason for hiding this comment

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

By placing the above lines here you are creating an empty annotationLayer for pages that have no annotations, I would prefer if we didn't do that.

@Snuffleupagus
Copy link
Collaborator

Good to go with comments addressed!

@ghost
Copy link
Author

ghost commented Apr 16, 2014

@Snuffleupagus @timvandermeij Done

// See this.reset()
self.annotationLayer.removeAttribute('hidden');
} else {
for (i = 0; i < annotationsData.length; i++) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please cache the length here as well.

This allows interactive annotations to keep their states after a resize
@ghost ghost changed the title Prevent the annotationLayer to be recreated when the page is redrawn Prevent the annotationLayer from being recreated when the page is redrawn Apr 16, 2014
@ghost
Copy link
Author

ghost commented Apr 16, 2014

Oops sorry. Done.

@yurydelendik
Copy link
Contributor

/botio-windows preview

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

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

yurydelendik added a commit that referenced this pull request Apr 16, 2014
Prevent the annotationLayer from being recreated when the page is redrawn
@yurydelendik yurydelendik merged commit 7069753 into mozilla:master Apr 16, 2014
@yurydelendik
Copy link
Contributor

Thank you for the patch

@ghost ghost deleted the annotations-refresh branch April 16, 2014 13:23
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.

4 participants