diff options
author | John Chen <zhang.z.chen@intel.com> | 2012-09-13 12:10:01 +0800 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-10-10 14:46:52 -0400 |
commit | 20e6064711abca6f540e18ec9feca8ece3720324 (patch) | |
tree | 5ae190a2c0a1e3a688e07b45243812c6a4229ba8 /ui/jquery.ui.draggable.js | |
parent | 77a4aaf47abe08f11eb4e0eabdb2a1c026c0f221 (diff) | |
download | jquery-ui-20e6064711abca6f540e18ec9feca8ece3720324.tar.gz jquery-ui-20e6064711abca6f540e18ec9feca8ece3720324.zip |
Draggable: Fix a bug when dragging into nested sortables there are duplicated placeholders. Fixes #7777 - Draggable and Nested Sortables bug.
Diffstat (limited to 'ui/jquery.ui.draggable.js')
-rw-r--r-- | ui/jquery.ui.draggable.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index e110bd8a4..5d91a3d94 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -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) { |