Browse Source

#707: + abs for _ghostIsLast

pull/739/head
RubaXa 9 years ago
parent
commit
569b1187bd
  1. 7
      Sortable.js

7
Sortable.js

@ -659,7 +659,6 @@
if ((el.children.length === 0) || (el.children[0] === ghostEl) || if ((el.children.length === 0) || (el.children[0] === ghostEl) ||
(el === evt.target) && (target = _ghostIsLast(el, evt)) (el === evt.target) && (target = _ghostIsLast(el, evt))
) { ) {
if (target) { if (target) {
if (target.animated) { if (target.animated) {
return; return;
@ -1187,7 +1186,11 @@
var lastEl = el.lastElementChild, var lastEl = el.lastElementChild,
rect = lastEl.getBoundingClientRect(); rect = lastEl.getBoundingClientRect();
return ((evt.clientY - (rect.top + rect.height) > 5) || (evt.clientX - (rect.right + rect.width) > 5)) && lastEl; // min delta // 5 — min delta
return (
(abs(evt.clientY - (rect.top + rect.height)) > 5) ||
(abs(evt.clientX - (rect.right + rect.width)) > 5)
) && lastEl;
} }

Loading…
Cancel
Save