upfront-editable
Version:
Friendly contenteditable API
13 lines (11 loc) • 581 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
// code from mdn: https://developer.mozilla.org/en-US/docs/Web/API/window.scrollX
function getScrollPosition(win) {
var x = win.pageXOffset !== undefined ? win.pageXOffset : (win.document.documentElement || win.document.body.parentNode || win.document.body).scrollLeft;
var y = win.pageYOffset !== undefined ? win.pageYOffset : (win.document.documentElement || win.document.body.parentNode || win.document.body).scrollTop;
return { x: x, y: y };
}
exports.getScrollPosition = getScrollPosition;