upfront-editable
Version:
Friendly contenteditable API
16 lines (14 loc) • 591 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getScrollPosition = getScrollPosition;
// 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
};
}