mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Draggable: Fix a bug when dragging into nested sortables there are duplicated placeholders. Fixes #7777 - Draggable and Nested Sortables bug.
This commit is contained in:
parent
77a4aaf47a
commit
20e6064711
16
ui/jquery.ui.draggable.js
vendored
16
ui/jquery.ui.draggable.js
vendored
@ -571,13 +571,29 @@ $.ui.plugin.add("draggable", "connectToSortable", {
|
|||||||
|
|
||||||
$.each(inst.sortables, function(i) {
|
$.each(inst.sortables, function(i) {
|
||||||
|
|
||||||
|
var innermostIntersecting = false;
|
||||||
|
var thisSortable = this;
|
||||||
//Copy over some variables to allow calling the sortable's native _intersectsWith
|
//Copy over some variables to allow calling the sortable's native _intersectsWith
|
||||||
this.instance.positionAbs = inst.positionAbs;
|
this.instance.positionAbs = inst.positionAbs;
|
||||||
this.instance.helperProportions = inst.helperProportions;
|
this.instance.helperProportions = inst.helperProportions;
|
||||||
this.instance.offset.click = inst.offset.click;
|
this.instance.offset.click = inst.offset.click;
|
||||||
|
|
||||||
if(this.instance._intersectsWith(this.instance.containerCache)) {
|
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 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) {
|
if(!this.instance.isOver) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user