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

Function completed

Sortable.js:1673–1723  ·  view source on GitHub ↗
(insertion)

Source from the content-addressed store, hash-verified

1671
1672 // Return invocation when dragEl is inserted (or completed)
1673 function completed(insertion) {
1674 dragOverEvent('dragOverCompleted', {
1675 insertion: insertion
1676 });
1677 if (insertion) {
1678 // Clones must be hidden before folding animation to capture dragRectAbsolute properly
1679 if (isOwner) {
1680 activeSortable._hideClone();
1681 } else {
1682 activeSortable._showClone(_this);
1683 }
1684 if (_this !== fromSortable) {
1685 // Set ghost class to new sortable's ghost class
1686 toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
1687 toggleClass(dragEl, options.ghostClass, true);
1688 }
1689 if (putSortable !== _this && _this !== Sortable.active) {
1690 putSortable = _this;
1691 } else if (_this === Sortable.active && putSortable) {
1692 putSortable = null;
1693 }
1694
1695 // Animation
1696 if (fromSortable === _this) {
1697 _this._ignoreWhileAnimating = target;
1698 }
1699 _this.animateAll(function () {
1700 dragOverEvent('dragOverAnimationComplete');
1701 _this._ignoreWhileAnimating = null;
1702 });
1703 if (_this !== fromSortable) {
1704 fromSortable.animateAll();
1705 fromSortable._ignoreWhileAnimating = null;
1706 }
1707 }
1708
1709 // Null lastTarget if it is not inside a previously swapped element
1710 if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
1711 lastTarget = null;
1712 }
1713
1714 // no bubbling and not fallback
1715 if (!options.dragoverBubble && !evt.rootEl && target !== document) {
1716 dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
1717
1718 // Do not detect for empty insert if already inserted
1719 !insertion && nearestEmptyInsertDetectEvent(evt);
1720 }
1721 !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
1722 return completedFired = true;
1723 }
1724
1725 // Call when dragEl has been inserted
1726 function changed() {

Callers 5

Sortable.jsFile · 0.70
SwapPluginFunction · 0.70
MultiDragPluginFunction · 0.70
dragOverFunction · 0.50
dragOverValidFunction · 0.50

Calls 3

dragOverEventFunction · 0.70
toggleClassFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…