Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Compute placeholder location if target and dnd-list are the same #487

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions angular-drag-and-drop-lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,26 @@
listNode.insertBefore(placeholderNode,
isFirstHalf ? listItemNode : listItemNode.nextSibling);
}
} else {
var listItemNode = null;
for(var i = 0; i < listNode.childNodes.length; i++){
var node = listNode.childNodes[i];
var rect = node.getBoundingClientRect();
if (listSettings.horizontal) {
if(rect.left > event.clientX) {
listItemNode = node;
break;
}
} else {
if(rect.top > event.clientY) {
listItemNode = node;
break;
}
}
}
if(node){
listNode.insertBefore(placeholderNode, node);
}
}

// In IE we set a fake effectAllowed in dragstart to get the correct cursor, we therefore
Expand Down