Skip to content

Commit

Permalink
SortableJS#356 Fixing issue where dropping an item on the right end o…
Browse files Browse the repository at this point in the history
…f a horizontally layed out drop zone does not add the item
  • Loading branch information
jsanchez034 committed Jul 30, 2015
1 parent 3be3b60 commit 15cae09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
}


Expand Down
Loading

0 comments on commit 15cae09

Please sign in to comment.