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

Function _ghostIsLast

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

Source from the content-addressed store, hash-verified

1820}
1821
1822function _ghostIsLast(evt, vertical, sortable) {
1823 const lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));
1824 const childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
1825 const spacer = 10;
1826
1827 return vertical ?
1828 (evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left) :
1829 (evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top);
1830}
1831
1832function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
1833 let mouseOnAxis = vertical ? evt.clientY : evt.clientX,

Callers 1

Sortable.jsFile · 0.70

Calls 3

getRectFunction · 0.90
lastChildFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…