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

Function _detectNearestEmptySortable

Sortable.js:961–974  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

959 * @return {HTMLElement} Element of the first found nearest Sortable
960 */
961 _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
962 var ret;
963 sortables.some(function (sortable) {
964 var threshold = sortable[expando].options.emptyInsertThreshold;
965 if (!threshold || lastChild(sortable)) return;
966 var rect = getRect(sortable),
967 insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
968 insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
969 if (insideHorizontally && insideVertically) {
970 return ret = sortable;
971 }
972 });
973 return ret;
974 },
975 _prepareGroup = function _prepareGroup(options) {
976 function toFn(value, pull) {
977 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…