Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Draggable: Fix a bug when dragging into nested sortables there are dupli... #728

Closed
wants to merge 1 commit into from

2 participants

@zhizhangchen

...cated placeholders

Fixing ticket: http://bugs.jqueryui.com/ticket/7777
Solution example: http://jsfiddle.net/zhizhangchen/GZ6Qr/ ( Removing jquery.ui.draggable.js from Resources will reproduce the bug)

@scottgonzalez

Thanks, landed in 20e6064.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 13, 2012
  1. @zhizhangchen
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 0 deletions.
  1. +16 −0 ui/jquery.ui.draggable.js
View
16 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) {
Something went wrong with that request. Please try again.