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

Function _getInsertDirection

src/Sortable.js:1909–1915  ·  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

1907 * @return {Number} Direction dragEl must be swapped
1908 */
1909function _getInsertDirection(target) {
1910 if (index(dragEl) < index(target)) {
1911 return 1;
1912 } else {
1913 return -1;
1914 }
1915}
1916
1917
1918/**

Callers 1

_getSwapDirectionFunction · 0.70

Calls 1

indexFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…