MCPcopy Index your code
hub / github.com/SortableJS/Sortable / getRelativeScrollOffset

Function getRelativeScrollOffset

Sortable.js:413–427  ·  view source on GitHub ↗

* Returns the scroll offset of the given element, added with all the scroll offsets of parent elements. * The value is returned in real pixels. * @param {HTMLElement} el * @return {Array} Offsets in the format of [left, top]

(el)

Source from the content-addressed store, hash-verified

411 * @return {Array} Offsets in the format of [left, top]
412 */
413 function getRelativeScrollOffset(el) {
414 var offsetLeft = 0,
415 offsetTop = 0,
416 winScroller = getWindowScrollingElement();
417 if (el) {
418 do {
419 var elMatrix = matrix(el),
420 scaleX = elMatrix.a,
421 scaleY = elMatrix.d;
422 offsetLeft += el.scrollLeft * scaleX;
423 offsetTop += el.scrollTop * scaleY;
424 } while (el !== winScroller && (el = el.parentNode));
425 }
426 return [offsetLeft, offsetTop];
427 }
428
429 /**
430 * Returns the index of the object within the given array

Callers 1

Sortable.jsFile · 0.70

Calls 2

matrixFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…