src/LiveDevelopment/Agents/RemoteFunctions.js
function _screenOffset(element) {
        var elemBounds = element.getBoundingClientRect(),
            body = window.document.body,
            offsetTop,
            offsetLeft;

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

        if (window.getComputedStyle(body).position === "static") {
            offsetLeft = elemBounds.left + window.pageXOffset;
            offsetTop = elemBounds.top + window.pageYOffset;
        } else {
            var bodyBounds = body.getBoundingClientRect();
            offsetLeft = elemBounds.left - bodyBounds.left;
            offsetTop = elemBounds.top - bodyBounds.top;
        }
        return { left: offsetLeft, top: offsetTop };
    }
function _screenOffset ( element ) { var elemBounds = element . getBoundingClientRect ( ) , body = window . document . body , offsetTop , offsetLeft ; if ( window . getComputedStyle ( body ) . position === "static" ) { offsetLeft = elemBounds . left + window . pageXOffset ; offsetTop = elemBounds . top + window . pageYOffset ; } else { var bodyBounds = body . getBoundingClientRect ( ) ; offsetLeft = elemBounds . left - bodyBounds . left ; offsetTop = elemBounds . top - bodyBounds . top ; } return { left : offsetLeft , top : offsetTop } ; }
compute the screen offset of an element
compute the screen offset of an element