From d9df31444b59d14f63d089ea275515b2cf5f396b Mon Sep 17 00:00:00 2001 From: William Date: Tue, 17 Apr 2018 15:14:23 -0700 Subject: [PATCH] Fixing Insertion Position Logic In 'Floating' Container - Insertion after non-adjacent sibling where insertion after is allowed - Insertion before non-adjacent sibling where insertion before is allowed - Fixing indentation --- Sortable.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sortable.js b/Sortable.js index 8b32dfb..7c472c1 100644 --- a/Sortable.js +++ b/Sortable.js @@ -843,15 +843,15 @@ tgTop = target.offsetTop; if (elTop === tgTop) { - after = (target.previousElementSibling === dragEl) && !isWide || halfway && isWide; + after = (target.previousElementSibling === dragEl) && !isWide || halfway; } else if (target.previousElementSibling === dragEl || dragEl.previousElementSibling === target) { after = (evt.clientY - targetRect.top) / height > 0.5; } else { - after = tgTop > elTop; + after = halfway; } - } else if (!isMovingBetweenSortable) { - after = (nextSibling !== dragEl) && !isLong || halfway && isLong; + } else if (!isMovingBetweenSortable) { + after = (nextSibling !== dragEl) && !isLong || halfway; } var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);