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

Function _ghostIsFirst

src/Sortable.js:1812–1820  ·  view source on GitHub ↗
(evt, vertical, sortable)

Source from the content-addressed store, hash-verified

1810}
1811
1812function _ghostIsFirst(evt, vertical, sortable) {
1813 let firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));
1814 const childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
1815 const spacer = 10;
1816
1817 return vertical ?
1818 (evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right) :
1819 (evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left)
1820}
1821
1822function _ghostIsLast(evt, vertical, sortable) {
1823 const lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));

Callers 1

Sortable.jsFile · 0.70

Calls 3

getRectFunction · 0.90
getChildFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…