Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Fix another bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Gerber committed Oct 14, 2014
1 parent b6688a9 commit d8443d6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/LiveDevelopment/Agents/RemoteFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ function RemoteFunctions(experimental) {
offsetTop,
offsetLeft;

offsetLeft = elemBounds.left + window.pageXOffset;
offsetTop = elemBounds.top + window.pageYOffset;

if (window.getComputedStyle(body).position !== "static") {
if (window.getComputedStyle(body).position === "static") {
offsetLeft = elemBounds.left + window.pageXOffset;
offsetTop = elemBounds.top + window.pageYOffset;
} else {
var bodyBounds = body.getBoundingClientRect();
offsetLeft -= bodyBounds.left;
offsetTop -= bodyBounds.top;
offsetLeft = elemBounds.left - bodyBounds.left;
offsetTop = elemBounds.top - bodyBounds.top;
}
return { left: offsetLeft, top: offsetTop };
}
Expand Down

0 comments on commit d8443d6

Please sign in to comment.