Browse Source

Fix drag and drop issue in "http://jsbin.com/fecaquk/edit?html,css,js,output"

pull/1106/head
mleung@riotgames.com 8 years ago
parent
commit
d69d501676
  1. 21
      Sortable.js
  2. 3
      Sortable.min.js

21
Sortable.js

@ -384,7 +384,7 @@
dragEl = target;
parentEl = dragEl.parentNode;
nextEl = dragEl.nextSibling;
lastDownEl = target
lastDownEl = target;
activeGroup = options.group;
oldIndex = startIndex;
@ -476,11 +476,11 @@
}
try {
if (document.selection) {
// Timeout neccessary for IE9
if (document.selection) {
// Timeout neccessary for IE9
setTimeout(function () {
document.selection.empty();
});
});
} else {
window.getSelection().removeAllRanges();
}
@ -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