MCPcopy
hub / github.com/SortableJS/Vue.Draggable / insertNodeAt

Function insertNodeAt

src/vuedraggable.js:19–25  ·  view source on GitHub ↗
(fatherNode, node, position)

Source from the content-addressed store, hash-verified

17}
18
19function insertNodeAt(fatherNode, node, position) {
20 const refNode =
21 position === 0
22 ? fatherNode.children[0]
23 : fatherNode.children[position - 1].nextSibling;
24 fatherNode.insertBefore(node, refNode);
25}
26
27function computeVmIndex(vnodes, element) {
28 return vnodes.map(elt => elt.elm).indexOf(element);

Callers 2

onDragRemoveFunction · 0.85
onDragUpdateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected