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

Function completed

modular/sortable.core.esm.js:1667–1717  ·  view source on GitHub ↗
(insertion)

Source from the content-addressed store, hash-verified

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

Callers 3

SwapPluginFunction · 0.70
MultiDragPluginFunction · 0.70

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…