Fix - Popover not in view
Browse files
assets/scripts/src/element.js
CHANGED
@@ -118,14 +118,21 @@ export default class Element {
|
|
118 |
|
119 |
const highlightedElement = this;
|
120 |
const lastHighlightedElement = this.overlay.getLastHighlightedElement();
|
|
|
121 |
|
122 |
const highlightedNode = this.node;
|
123 |
const lastHighlightedNode = lastHighlightedElement && lastHighlightedElement.node;
|
124 |
|
125 |
// If this element is not already highlighted (because this call could
|
126 |
// be from the resize or scroll) and is not in view
|
127 |
-
if (highlightedNode !== lastHighlightedNode
|
128 |
-
highlightedElement.
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
}
|
130 |
}
|
131 |
|
|
|
118 |
|
119 |
const highlightedElement = this;
|
120 |
const lastHighlightedElement = this.overlay.getLastHighlightedElement();
|
121 |
+
const popoverElement = this.popover;
|
122 |
|
123 |
const highlightedNode = this.node;
|
124 |
const lastHighlightedNode = lastHighlightedElement && lastHighlightedElement.node;
|
125 |
|
126 |
// If this element is not already highlighted (because this call could
|
127 |
// be from the resize or scroll) and is not in view
|
128 |
+
if (highlightedNode !== lastHighlightedNode) {
|
129 |
+
if (!highlightedElement.isInView()) {
|
130 |
+
highlightedElement.bringInView();
|
131 |
+
}
|
132 |
+
|
133 |
+
if (!popoverElement.isInView()) {
|
134 |
+
popoverElement.bringInView();
|
135 |
+
}
|
136 |
}
|
137 |
}
|
138 |
|