Merge pull request #12621 from calixteman/12614
Follow-up for #12585: set elements class in render instead of in _createQuadrilaterals
This commit is contained in:
commit
bfc5d0d57c
@ -259,16 +259,13 @@ class AnnotationElement {
|
|||||||
const quadrilaterals = [];
|
const quadrilaterals = [];
|
||||||
const savedRect = this.data.rect;
|
const savedRect = this.data.rect;
|
||||||
for (const quadPoint of this.data.quadPoints) {
|
for (const quadPoint of this.data.quadPoints) {
|
||||||
const rect = [
|
this.data.rect = [
|
||||||
quadPoint[2].x,
|
quadPoint[2].x,
|
||||||
quadPoint[2].y,
|
quadPoint[2].y,
|
||||||
quadPoint[1].x,
|
quadPoint[1].x,
|
||||||
quadPoint[1].y,
|
quadPoint[1].y,
|
||||||
];
|
];
|
||||||
this.data.rect = rect;
|
quadrilaterals.push(this._createContainer(ignoreBorder));
|
||||||
const quad = this._createContainer(ignoreBorder);
|
|
||||||
quad.className = "highlightAnnotation";
|
|
||||||
quadrilaterals.push(quad);
|
|
||||||
}
|
}
|
||||||
this.data.rect = savedRect;
|
this.data.rect = savedRect;
|
||||||
return quadrilaterals;
|
return quadrilaterals;
|
||||||
@ -1390,12 +1387,19 @@ class HighlightAnnotationElement extends AnnotationElement {
|
|||||||
* @returns {HTMLSectionElement}
|
* @returns {HTMLSectionElement}
|
||||||
*/
|
*/
|
||||||
render() {
|
render() {
|
||||||
this.container.className = "highlightAnnotation";
|
|
||||||
|
|
||||||
if (!this.data.hasPopup) {
|
if (!this.data.hasPopup) {
|
||||||
this._createPopup(null, this.data);
|
this._createPopup(null, this.data);
|
||||||
}
|
}
|
||||||
return this.quadrilaterals || this.container;
|
|
||||||
|
if (this.quadrilaterals) {
|
||||||
|
this.quadrilaterals.forEach(quadrilateral => {
|
||||||
|
quadrilateral.className = "highlightAnnotation";
|
||||||
|
});
|
||||||
|
return this.quadrilaterals;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.container.className = "highlightAnnotation";
|
||||||
|
return this.container;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user