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

413 performance issues #419

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
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
11 changes: 9 additions & 2 deletions angular-drag-and-drop-lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,15 @@
} else {
var isFirstHalf = event.clientY < rect.top + rect.height / 2;
}
listNode.insertBefore(placeholderNode,
isFirstHalf ? listItemNode : listItemNode.nextSibling);
if(isFirstHalf) {
if(listItemNode.previousSibling != placeholderNode) {
listNode.insertBefore(placeholderNode, listItemNode);
}
} else {
if(listItemNode.nextSibling != placeholderNode) {
listNode.insertBefore(placeholderNode, listItemNode.nextSibling);
}
}
}
}

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"description": "Angular directives for sorting nested lists using the HTML5 Drag and Drop API",
"repository": "https://github.com/marceljuenemann/angular-drag-and-drop-lists",
"license": "MIT",
"main": "angular-drag-and-drop-lists.js",
"devDependencies": {
"angular": "~1.4.9",
"angular-mocks": "~1.4.9",
Expand Down