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

Function _detectNearestEmptySortable

src/Sortable.js:230–245  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

228 * @return {HTMLElement} Element of the first found nearest Sortable
229 */
230 _detectNearestEmptySortable = function(x, y) {
231 let ret;
232 sortables.some((sortable) => {
233 const threshold = sortable[expando].options.emptyInsertThreshold;
234 if (!threshold || lastChild(sortable)) return;
235
236 const rect = getRect(sortable),
237 insideHorizontally = x >= (rect.left - threshold) && x <= (rect.right + threshold),
238 insideVertically = y >= (rect.top - threshold) && y <= (rect.bottom + threshold);
239
240 if (insideHorizontally && insideVertically) {
241 return (ret = sortable);
242 }
243 });
244 return ret;
245 },
246
247 _prepareGroup = function (options) {
248 function toFn(value, pull) {

Callers 1

Calls 2

lastChildFunction · 0.90
getRectFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…