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

Function completed

src/Sortable.js:1059–1113  ·  view source on GitHub ↗
(insertion)

Source from the content-addressed store, hash-verified

1057
1058 // Return invocation when dragEl is inserted (or completed)
1059 function completed(insertion) {
1060 dragOverEvent('dragOverCompleted', { insertion });
1061
1062 if (insertion) {
1063 // Clones must be hidden before folding animation to capture dragRectAbsolute properly
1064 if (isOwner) {
1065 activeSortable._hideClone();
1066 } else {
1067 activeSortable._showClone(_this);
1068 }
1069
1070 if (_this !== fromSortable) {
1071 // Set ghost class to new sortable's ghost class
1072 toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
1073 toggleClass(dragEl, options.ghostClass, true);
1074 }
1075
1076 if (putSortable !== _this && _this !== Sortable.active) {
1077 putSortable = _this;
1078 } else if (_this === Sortable.active && putSortable) {
1079 putSortable = null;
1080 }
1081
1082 // Animation
1083 if (fromSortable === _this) {
1084 _this._ignoreWhileAnimating = target;
1085 }
1086 _this.animateAll(function() {
1087 dragOverEvent('dragOverAnimationComplete');
1088 _this._ignoreWhileAnimating = null;
1089 });
1090 if (_this !== fromSortable) {
1091 fromSortable.animateAll();
1092 fromSortable._ignoreWhileAnimating = null;
1093 }
1094 }
1095
1096
1097 // Null lastTarget if it is not inside a previously swapped element
1098 if ((target === dragEl && !dragEl.animated) || (target === el && !target.animated)) {
1099 lastTarget = null;
1100 }
1101
1102 // no bubbling and not fallback
1103 if (!options.dragoverBubble && !evt.rootEl && target !== document) {
1104 dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
1105
1106 // Do not detect for empty insert if already inserted
1107 !insertion && nearestEmptyInsertDetectEvent(evt);
1108 }
1109
1110 !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
1111
1112 return (completedFired = true);
1113 }
1114
1115 // Call when dragEl has been inserted
1116 function changed() {

Callers 1

Sortable.jsFile · 0.70

Calls 3

toggleClassFunction · 0.90
dragOverEventFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…