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

Function swapNodes

modular/sortable.esm.js:2755–2768  ·  view source on GitHub ↗
(n1, n2)

Source from the content-addressed store, hash-verified

2753 });
2754}
2755function swapNodes(n1, n2) {
2756 var p1 = n1.parentNode,
2757 p2 = n2.parentNode,
2758 i1,
2759 i2;
2760 if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;
2761 i1 = index(n1);
2762 i2 = index(n2);
2763 if (p1.isEqualNode(p2) && i1 < i2) {
2764 i2++;
2765 }
2766 p1.insertBefore(n2, p1.children[i1]);
2767 p2.insertBefore(n1, p2.children[i2]);
2768}
2769
2770var multiDragElements = [],
2771 multiDragClones = [],

Callers 1

SwapPluginFunction · 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…