MCPcopy
hub / github.com/bevacqua/dragula / findDropTarget

Function findDropTarget

dragula.js:337–358  ·  view source on GitHub ↗
(elementBehindCursor, clientX, clientY)

Source from the content-addressed store, hash-verified

335 }
336
337 function findDropTarget (elementBehindCursor, clientX, clientY) {
338 var target = elementBehindCursor;
339 while (target && !accepted()) {
340 target = getParent(target);
341 }
342 return target;
343
344 function accepted () {
345 var droppable = isContainer(target);
346 if (droppable === false) {
347 return false;
348 }
349
350 var immediate = getImmediateChild(target, elementBehindCursor);
351 var reference = getReference(target, immediate, clientX, clientY);
352 var initial = isInitialPlacement(target, reference);
353 if (initial) {
354 return true; // should always be able to drop it right back where it was
355 }
356 return o.accepts(_item, target, _source, reference);
357 }
358 }
359
360 function drag (e) {
361 if (!_mirror) {

Callers 2

releaseFunction · 0.85
dragFunction · 0.85

Calls 2

acceptedFunction · 0.85
getParentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…