Fix - Clear overlay error
Browse files
assets/scripts/src/overlay.js
CHANGED
@@ -86,12 +86,7 @@ export default class Overlay {
|
|
86 |
this.positionToHighlight = new Position();
|
87 |
this.highlightedElement = null;
|
88 |
|
89 |
-
|
90 |
-
// This will stop the animation from the animation frames above
|
91 |
-
if (!this.animate) {
|
92 |
-
this.window.cancelAnimationFrame(this.redrawAnimation);
|
93 |
-
this.document.body.removeChild(this.overlay);
|
94 |
-
}
|
95 |
}
|
96 |
|
97 |
/**
|
@@ -163,7 +158,8 @@ export default class Overlay {
|
|
163 |
) {
|
164 |
this.redrawAnimation = this.window.requestAnimationFrame(this.draw);
|
165 |
}
|
166 |
-
} else {
|
|
|
167 |
this.document.body.removeChild(this.overlay);
|
168 |
}
|
169 |
}
|
|
|
86 |
this.positionToHighlight = new Position();
|
87 |
this.highlightedElement = null;
|
88 |
|
89 |
+
this.draw();
|
|
|
|
|
|
|
|
|
|
|
90 |
}
|
91 |
|
92 |
/**
|
|
|
158 |
) {
|
159 |
this.redrawAnimation = this.window.requestAnimationFrame(this.draw);
|
160 |
}
|
161 |
+
} else if (this.overlay.parentNode) {
|
162 |
+
// Otherwise if the overlay is there, remove it
|
163 |
this.document.body.removeChild(this.overlay);
|
164 |
}
|
165 |
}
|