Browse Source

#356 Fixing issue where dropping an item on the right end of a horizontally layed out drop zone does not add the item

pull/496/head
JP 10 years ago
parent
commit
15cae09423
  1. 8
      Sortable.js
  2. 2
      Sortable.min.js

8
Sortable.js

@ -591,7 +591,7 @@
if ((el.children.length === 0) || (el.children[0] === ghostEl) ||
(el === evt.target) && (target = _ghostInBottom(el, evt))
(el === evt.target) && (target = _ghostIsLast(el, evt))
) {
if (target) {
if (target.animated) {
@ -1086,11 +1086,11 @@
/** @returns {HTMLElement|false} */
function _ghostInBottom(el, evt) {
function _ghostIsLast(el, evt) {
var lastEl = el.lastElementChild,
rect = lastEl.getBoundingClientRect();
rect = lastEl.getBoundingClientRect();
return (evt.clientY - (rect.top + rect.height) > 5) && lastEl; // min delta
return ((evt.clientY - (rect.top + rect.height) > 5) || (evt.clientX - (rect.right + rect.width) > 5)) && lastEl; // min delta
}

2
Sortable.min.js vendored

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