Move link creation logic to src/display/annotation_layer.js

Additionally simplify the div creation logic (it needs to happen only
once, so it should not be in the for-loop) and remove/rename variables
for shorter code.
This commit is contained in:
Tim van der Meij 2015-12-08 23:38:32 +01:00
parent 2dc3ee38c0
commit bce3214105
3 changed files with 56 additions and 62 deletions

View file

@ -275,7 +275,7 @@ var PDFPageView = (function PDFPageViewClosure() {
}
if (redrawAnnotations && this.annotationLayer) {
this.annotationLayer.setupAnnotations(this.viewport, 'display');
this.annotationLayer.render(this.viewport, 'display');
}
},
@ -507,7 +507,7 @@ var PDFPageView = (function PDFPageViewClosure() {
this.annotationLayer = this.annotationsLayerFactory.
createAnnotationsLayerBuilder(div, this.pdfPage);
}
this.annotationLayer.setupAnnotations(this.viewport, 'display');
this.annotationLayer.render(this.viewport, 'display');
}
div.setAttribute('data-loaded', true);