Browse Source

avoid changing oldIndex by the parent container

should fix #618 and #597

oldIndex was changed first by with the item being dragged, but also by the drag event of the parent (which should be avoided when we are not using the drag-handle)
pull/624/head
Cyril Auburtin 9 years ago
parent
commit
a4e003d4df
  1. 10
      Sortable.js

10
Sortable.js

@ -269,6 +269,10 @@
if (!target) {
return;
}
if (options.handle && !_closest(originalTarget, options.handle, el)) {
return;
}
// get the index of the dragged element within its parent
oldIndex = _index(target);
@ -297,12 +301,6 @@
}
}
if (options.handle && !_closest(originalTarget, options.handle, el)) {
return;
}
// Prepare `dragstart`
this._prepareDragStart(evt, touch, target);
},

Loading…
Cancel
Save