|
|
@@ -18,7 +18,7 @@
|
|
|
* along with SingleFile. If not, see <http://www.gnu.org/licenses/>.
|
|
|
*/
|
|
|
|
|
|
-/* global browser, document, getComputedStyle, addEventListener, removeEventListener, requestAnimationFrame, scrollX, scrollY, setTimeout */
|
|
|
+/* global browser, document, getComputedStyle, addEventListener, removeEventListener, requestAnimationFrame, setTimeout */
|
|
|
|
|
|
this.singlefile.ui = this.singlefile.ui || (() => {
|
|
|
|
|
|
@@ -159,8 +159,8 @@ this.singlefile.ui = this.singlefile.ui || (() => {
|
|
|
requestAnimationFrame(() => {
|
|
|
const selectorElement = createAreaSelector();
|
|
|
const boundingRect = target.getBoundingClientRect();
|
|
|
- selectorElement.style.setProperty("top", (scrollY + boundingRect.top - 10) + "px");
|
|
|
- selectorElement.style.setProperty("left", (scrollX + boundingRect.left - 10) + "px");
|
|
|
+ selectorElement.style.setProperty("top", (document.documentElement.scrollTop + boundingRect.top - 10) + "px");
|
|
|
+ selectorElement.style.setProperty("left", (document.documentElement.scrollLeft + boundingRect.left - 10) + "px");
|
|
|
selectorElement.style.setProperty("width", (boundingRect.width + 20) + "px");
|
|
|
selectorElement.style.setProperty("height", (boundingRect.height + 20) + "px");
|
|
|
});
|