Merge pull request #8847 from Snuffleupagus/AnnotationElement-isRenderable-regression

Correct the default value for `isRenderable` in the `AnnotationElement` constructor, to fix breaking errors when rendering unsupported annotations
This commit is contained in:
Tim van der Meij 2017-08-31 22:08:10 +02:00 committed by GitHub
commit 51be27853f

View File

@ -95,7 +95,7 @@ class AnnotationElementFactory {
} }
class AnnotationElement { class AnnotationElement {
constructor(parameters, isRenderable = true, ignoreBorder = false) { constructor(parameters, isRenderable = false, ignoreBorder = false) {
this.isRenderable = isRenderable; this.isRenderable = isRenderable;
this.data = parameters.data; this.data = parameters.data;
this.layer = parameters.layer; this.layer = parameters.layer;
@ -250,6 +250,10 @@ class AnnotationElement {
} }
class LinkAnnotationElement extends AnnotationElement { class LinkAnnotationElement extends AnnotationElement {
constructor(parameters) {
super(parameters, /* isRenderable = */ true);
}
/** /**
* Render the link annotation's HTML element in the empty container. * Render the link annotation's HTML element in the empty container.
* *
@ -902,7 +906,7 @@ class StrikeOutAnnotationElement extends AnnotationElement {
class FileAttachmentAnnotationElement extends AnnotationElement { class FileAttachmentAnnotationElement extends AnnotationElement {
constructor(parameters) { constructor(parameters) {
super(parameters, true); super(parameters, /* isRenderable = */ true);
let file = this.data.file; let file = this.data.file;
this.filename = getFilenameFromUrl(file.filename); this.filename = getFilenameFromUrl(file.filename);