Skip to content

Commit

Permalink
Draggable: Fix a bug when dragging into nested sortables there are du…
Browse files Browse the repository at this point in the history
…plicated placeholders. Fixes #7777 - Draggable and Nested Sortables bug.
  • Loading branch information
zhizhangchen authored and scottgonzalez committed Oct 10, 2012
1 parent 77a4aaf commit 20e6064
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ui/jquery.ui.draggable.js
Expand Up @@ -571,13 +571,29 @@ $.ui.plugin.add("draggable", "connectToSortable", {

$.each(inst.sortables, function(i) {

var innermostIntersecting = false;
var thisSortable = this;
//Copy over some variables to allow calling the sortable's native _intersectsWith
this.instance.positionAbs = inst.positionAbs;
this.instance.helperProportions = inst.helperProportions;
this.instance.offset.click = inst.offset.click;

if(this.instance._intersectsWith(this.instance.containerCache)) {
innermostIntersecting = true;
$.each(inst.sortables, function () {
this.instance.positionAbs = inst.positionAbs;
this.instance.helperProportions = inst.helperProportions;
this.instance.offset.click = inst.offset.click;
if (this != thisSortable
&& this.instance._intersectsWith(this.instance.containerCache)
&& $.ui.contains(thisSortable.instance.element[0], this.instance.element[0]))
innermostIntersecting = false;
return innermostIntersecting;
});
}


if(innermostIntersecting) {
//If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
if(!this.instance.isOver) {

Expand Down

0 comments on commit 20e6064

Please sign in to comment.