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

Function getParentAutoScrollElement

Sortable.js:444–462  ·  view source on GitHub ↗
(el, includeSelf)

Source from the content-addressed store, hash-verified

442 return -1;
443 }
444 function getParentAutoScrollElement(el, includeSelf) {
445 // skip to window
446 if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
447 var elem = el;
448 var gotSelf = false;
449 do {
450 // we don't need to get elem css if it isn't even overflowing in the first place (performance)
451 if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
452 var elemCSS = css(elem);
453 if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
454 if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
455 if (gotSelf || includeSelf) return elem;
456 gotSelf = true;
457 }
458 }
459 /* jshint boss:true */
460 } while (elem = elem.parentNode);
461 return getWindowScrollingElement();
462 }
463 function extend(dst, src) {
464 if (dst && src) {
465 for (var key in src) {

Callers 5

_handleAutoScrollFunction · 0.90
AutoScroll.jsFile · 0.90
isScrolledPastFunction · 0.70
AutoScrollPluginFunction · 0.70
Sortable.jsFile · 0.70

Calls 2

cssFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…