-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Conversation
@Snuffleupagus: Done |
/botio-windows preview |
From: Bot.io (Windows)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/9eb9cad7a34d0b9/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/9eb9cad7a34d0b9/output.txt Total script time: 0.64 mins Published
|
@dferer Could you rebase this PR? |
@timvandermeij Done |
var annotationLayerDiv = document.createElement('div'); | ||
annotationLayerDiv.className = 'annotationLayer'; | ||
pageDiv.appendChild(annotationLayerDiv); | ||
self.annotationLayer = annotationLayerDiv; |
There was a problem hiding this comment.
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.
Good to go with comments addressed! |
// See this.reset() | ||
self.annotationLayer.removeAttribute('hidden'); | ||
} else { | ||
for (i = 0; i < annotationsData.length; i++) { |
There was a problem hiding this comment.
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
Oops sorry. Done. |
/botio-windows preview |
From: Bot.io (Windows)ReceivedCommand cmd_preview from @yurydelendik received. Current queue size: 1 Live output at: http://107.22.172.223:8877/b6750767b6a69ae/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/b6750767b6a69ae/output.txt Total script time: 0.41 mins Published
|
Prevent the annotationLayer from being recreated when the page is redrawn
Thank you for the patch |
This allows interactive annotations (current and future) to keep their states after a resize