Browse Source

Merge pull request #1106 from marvin659/dev

Fix drag and drop issue in "http://jsbin.com/fecaquk/edit?html,css,js
pull/867/merge
Lebedev Konstantin 8 years ago committed by GitHub
parent
commit
78b6f4dc37
  1. 15
      Sortable.js
  2. 3
      Sortable.min.js

15
Sortable.js

@ -384,7 +384,7 @@
dragEl = target;
parentEl = dragEl.parentNode;
nextEl = dragEl.nextSibling;
lastDownEl = target
lastDownEl = target;
activeGroup = options.group;
oldIndex = startIndex;
@ -724,8 +724,13 @@
if ((el.children.length === 0) || (el.children[0] === ghostEl) ||
(el === evt.target) && (target = _ghostIsLast(el, evt))
(el === evt.target) && (_ghostIsLast(el, evt))
) {
//assign target only if condition is true
if (el.children.length !== 0 && el.children[0] !== ghostEl && el === evt.target) {
target = el.lastElementChild;
}
if (target) {
if (target.animated) {
return;
@ -1290,10 +1295,8 @@
// 5 — min delta
// abs — нельзя добавлять, а то глюки при наведении сверху
return (
(evt.clientY - (rect.top + rect.height) > 5) ||
(evt.clientX - (rect.right + rect.width) > 5)
) && lastEl;
return (evt.clientY - (rect.top + rect.height) > 5) ||
(evt.clientX - (rect.left + rect.width) > 5);
}

3
Sortable.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save