Skip to content

Commit

Permalink
Merge pull request #6475 from Snuffleupagus/PDFPageView-annotationLay…
Browse files Browse the repository at this point in the history
…er-div

Tweak `PDFPageView` to reflect that `this.annotationLayer` is an `AnnotationsLayerBuilder` instance, instead of a DOM element (PR 5552 follow-up)
  • Loading branch information
timvandermeij committed Sep 29, 2015
2 parents 7cdc6f3 + c7fd7f8 commit e28ad20
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions web/pdf_page_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,10 @@ var PDFPageView = (function PDFPageViewClosure() {
}
div.removeAttribute('data-loaded');

if (keepAnnotations) {
if (this.annotationLayer) {
// Hide annotationLayer until all elements are resized
// so they are not displayed on the already-resized page
this.annotationLayer.hide();
}
if (currentAnnotationNode) {
// Hide annotationLayer until all elements are resized
// so they are not displayed on the already-resized page
this.annotationLayer.hide();
} else {
this.annotationLayer = null;
}
Expand Down Expand Up @@ -305,7 +303,7 @@ var PDFPageView = (function PDFPageViewClosure() {
var canvas = document.createElement('canvas');
canvas.id = 'page' + this.id;
canvasWrapper.appendChild(canvas);
if (this.annotationLayer) {
if (this.annotationLayer && this.annotationLayer.div) {
// annotationLayer needs to stay on top
div.insertBefore(canvasWrapper, this.annotationLayer.div);
} else {
Expand Down Expand Up @@ -352,7 +350,7 @@ var PDFPageView = (function PDFPageViewClosure() {
textLayerDiv.className = 'textLayer';
textLayerDiv.style.width = canvas.style.width;
textLayerDiv.style.height = canvas.style.height;
if (this.annotationLayer) {
if (this.annotationLayer && this.annotationLayer.div) {
// annotationLayer needs to stay on top
div.insertBefore(textLayerDiv, this.annotationLayer.div);
} else {
Expand Down

0 comments on commit e28ad20

Please sign in to comment.