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

Function dragOverValid

plugins/Swap/Swap.js:20–41  ·  view source on GitHub ↗
({ completed, target, onMove, activeSortable, changed, cancel })

Source from the content-addressed store, hash-verified

18 lastSwapEl = dragEl;
19 },
20 dragOverValid({ completed, target, onMove, activeSortable, changed, cancel }) {
21 if (!activeSortable.options.swap) return;
22 let el = this.sortable.el,
23 options = this.options;
24 if (target && target !== el) {
25 let prevSwapEl = lastSwapEl;
26 if (onMove(target) !== false) {
27 toggleClass(target, options.swapClass, true);
28 lastSwapEl = target;
29 } else {
30 lastSwapEl = null;
31 }
32
33 if (prevSwapEl && prevSwapEl !== lastSwapEl) {
34 toggleClass(prevSwapEl, options.swapClass, false);
35 }
36 }
37 changed();
38
39 completed(true);
40 cancel();
41 },
42 drop({ activeSortable, putSortable, dragEl }) {
43 let toSortable = (putSortable || this.sortable);
44 let options = this.options;

Callers

nothing calls this directly

Calls 4

toggleClassFunction · 0.90
onMoveFunction · 0.85
changedFunction · 0.50
completedFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…