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

Function _getInsertDirection

modular/sortable.core.esm.js:2304–2310  ·  view source on GitHub ↗

* Gets the direction dragEl must be swapped relative to target in order to make it * seem that dragEl has been "inserted" into that element's position * @param {HTMLElement} target The target whose position dragEl is being inserted at * @return {Number} Direction dragEl m

(target)

Source from the content-addressed store, hash-verified

2302 * @return {Number} Direction dragEl must be swapped
2303 */
2304function _getInsertDirection(target) {
2305 if (index(dragEl) < index(target)) {
2306 return 1;
2307 } else {
2308 return -1;
2309 }
2310}
2311
2312/**
2313 * Generate id

Callers 1

_getSwapDirectionFunction · 0.70

Calls 1

indexFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…