MCPcopy Create free account
hub / github.com/docker/getting-started / attachToScrollParents

Function attachToScrollParents

app/src/static/js/react-bootstrap.js:4003–4015  ·  view source on GitHub ↗
(scrollParent, event, callback, scrollParents)

Source from the content-addressed store, hash-verified

4001}
4002
4003function attachToScrollParents(scrollParent, event, callback, scrollParents) {
4004 var isBody = scrollParent.nodeName === 'BODY';
4005 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
4006 target.addEventListener(event, callback, {
4007 passive: true
4008 });
4009
4010 if (!isBody) {
4011 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
4012 }
4013
4014 scrollParents.push(target);
4015}
4016/**
4017 * Setup needed event listeners used to update the popper position
4018 * @method

Callers 1

setupEventListenersFunction · 0.85

Calls 1

getScrollParentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…