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

Function _ghostIsFirst

modular/sortable.complete.esm.js:2245–2250  ·  view source on GitHub ↗
(evt, vertical, sortable)

Source from the content-addressed store, hash-verified

2243 _silent = false;
2244}
2245function _ghostIsFirst(evt, vertical, sortable) {
2246 var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));
2247 var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
2248 var spacer = 10;
2249 return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;
2250}
2251function _ghostIsLast(evt, vertical, sortable) {
2252 var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));
2253 var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);

Callers 1

Calls 3

getRectFunction · 0.70
getChildFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…