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

Function _detectNearestEmptySortable

modular/sortable.complete.esm.js:955–968  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

953 * @return {HTMLElement} Element of the first found nearest Sortable
954 */
955 _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
956 var ret;
957 sortables.some(function (sortable) {
958 var threshold = sortable[expando].options.emptyInsertThreshold;
959 if (!threshold || lastChild(sortable)) return;
960 var rect = getRect(sortable),
961 insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
962 insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
963 if (insideHorizontally && insideVertically) {
964 return ret = sortable;
965 }
966 });
967 return ret;
968 },
969 _prepareGroup = function _prepareGroup(options) {
970 function toFn(value, pull) {
971 return function (to, from, dragEl, evt) {

Callers 1

Calls 2

lastChildFunction · 0.70
getRectFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…