From 57266e1ba467e67120e023491082db31ce1fa787 Mon Sep 17 00:00:00 2001 From: Paul Bakaus Date: Sun, 25 May 2008 16:50:18 +0000 Subject: [PATCH] draggable, droppable: added a class do the active draggable helper, that will be ignored by droppables as droppable target (fixes #2886) --- ui/source/ui.draggable.js | 2 ++ ui/source/ui.droppable.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/source/ui.draggable.js b/ui/source/ui.draggable.js index f012e6f53..ac74ae00a 100644 --- a/ui/source/ui.draggable.js +++ b/ui/source/ui.draggable.js @@ -118,6 +118,7 @@ this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Recache the helper size if ($.ui.ddmanager && !o.dropBehaviour) $.ui.ddmanager.prepareOffsets(this, e); + this.helper.addClass("ui-draggable-dragging"); this.mouseDrag(e); //Execute the drag once - this causes the helper not to be visible before getting its correct position return true; }, @@ -223,6 +224,7 @@ return false; }, clear: function() { + this.helper.removeClass("ui-draggable-dragging"); if(this.options.helper != 'original' && !this.cancelHelperRemoval) this.helper.remove(); if($.ui.ddmanager) $.ui.ddmanager.current = null; this.helper = null; diff --git a/ui/source/ui.droppable.js b/ui/source/ui.droppable.js index 7dcd86b28..546eda7ff 100644 --- a/ui/source/ui.droppable.js +++ b/ui/source/ui.droppable.js @@ -96,7 +96,7 @@ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element var childrenIntersection = false; - this.element.find(".ui-droppable").each(function() { + this.element.find(".ui-droppable").not(".ui-draggable-dragging").each(function() { var inst = $.data(this, 'droppable'); if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) { childrenIntersection = true; return false;