diff --git a/src/doc/DocHighlightThread.js b/src/doc/DocHighlightThread.js index 369a76502..9bcec84c8 100644 --- a/src/doc/DocHighlightThread.js +++ b/src/doc/DocHighlightThread.js @@ -463,7 +463,7 @@ class DocHighlightThread extends AnnotationThread { // Position it below lower right corner or center of the highlight - we need // to reposition every time since the DOM could have changed from // zooming - const pageEl = this.popoverParent; + const pageEl = this.getPopoverParent(); const pageDimensions = pageEl.getBoundingClientRect(); const pageHeight = pageDimensions.height - PAGE_PADDING_TOP - PAGE_PADDING_BOTTOM; const [browserX, browserY] = docUtil.getScaledPDFCoordinates( diff --git a/src/doc/DocPointThread.js b/src/doc/DocPointThread.js index a2858c823..b3b78d10b 100644 --- a/src/doc/DocPointThread.js +++ b/src/doc/DocPointThread.js @@ -53,7 +53,7 @@ class DocPointThread extends AnnotationThread { return; } - const pageEl = this.popoverParent; + const pageEl = this.getPopoverParent(); const popoverEl = findElement( this.annotatedElement, SELECTOR_CLASS_ANNOTATION_POPOVER, diff --git a/src/image/ImagePointThread.js b/src/image/ImagePointThread.js index f05b8ba06..025c07208 100644 --- a/src/image/ImagePointThread.js +++ b/src/image/ImagePointThread.js @@ -49,7 +49,8 @@ class ImagePointThread extends AnnotationThread { const threadIconLeftX = this.element.offsetLeft + POINT_ANNOTATION_ICON_WIDTH / 2; let dialogLeftX = threadIconLeftX - dialogWidth / 2; - const isUpperHalf = isInUpperHalf(this.element, this.popoverParent); + const popoverParentEl = this.getPopoverParent(); + const isUpperHalf = isInUpperHalf(this.element, popoverParentEl); const flippedPopoverOffset = isUpperHalf ? 0 : popoverEl.getBoundingClientRect().height + @@ -71,8 +72,8 @@ class ImagePointThread extends AnnotationThread { // just center the dialog and cause scrolling since there is nothing // else we can do const pageWidth = - this.popoverParent.clientWidth > this.annotatedElement.clientWidth - ? this.popoverParent.clientWidth + popoverParentEl.clientWidth > this.annotatedElement.clientWidth + ? popoverParentEl.clientWidth : this.annotatedElement.clientWidth; dialogLeftX = repositionCaret(popoverEl, dialogLeftX, dialogWidth, threadIconLeftX, pageWidth, !isUpperHalf);