Browse Source

Merge pull request #605 from 4imble/master

Fix to knockout sorting when dragging item index 1 to 0.
pull/611/head
Lebedev Konstantin 9 years ago
parent
commit
a531e51fd2
  1. 6
      knockout-sortable.js

6
knockout-sortable.js

@ -84,9 +84,11 @@
newIndex = e.newIndex;
if (e.item.previousElementSibling)
{
newIndex = fromArray.indexOf(ko.dataFor(e.item.previousElementSibling));
if (originalIndex > newIndex)
newIndex = newIndex + 1;
if (originalIndex > newIndex)
newIndex = newIndex + 1;
}
//Remove sortables "unbound" element
e.item.parentNode.removeChild(e.item);

Loading…
Cancel
Save