Skip to content

Commit

Permalink
Merge pull request #2 from sp-kilobug/sp-kilobug-patch-2
Browse files Browse the repository at this point in the history
SortableJS#422: fix fallback moves in owner container
  • Loading branch information
sp-kilobug committed Jun 26, 2015
2 parents accea44 + 91c560c commit 38fc17b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1027,11 +1027,14 @@

/** @returns {HTMLElement|false} */
function _ghostInBottom(el, evt) {
var lastEl = el.lastElementChild,
rect = lastEl.getBoundingClientRect();

return (evt.clientY - (rect.top + rect.height) > 5) && lastEl; // min delta
}
+ var lastEl = el.lastElementChild;
+ if (lastEl===ghostEl) {
+ lastEl = lastEl.previousElementSibling || ghostEl;
+ }
+ var rect = lastEl.getBoundingClientRect();

return (evt.clientY - (rect.top + rect.height) > 5) && lastEl; // min delta
}


/**
Expand Down

0 comments on commit 38fc17b

Please sign in to comment.