Browse Source

Merge pull request #496 from jsanchez034/dev

#356 Fixing issue of dropping on the right end of horizontally laid out drop zones
pull/499/head
Lebedev Konstantin 9 years ago
parent
commit
4eaf54d1da
  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