Merge pull request #6475 from Snuffleupagus/PDFPageView-annotationLayer-div

Tweak `PDFPageView` to reflect that `this.annotationLayer` is an `AnnotationsLayerBuilder` instance, instead of a DOM element (PR 5552 follow-up)
This commit is contained in:
Tim van der Meij 2015-09-29 23:38:04 +02:00
commit e28ad20d15

View File

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