r3108 committed - droppable: greedy childs that dont accept the draggable dont block pro...

r3108 committed - droppable: greedy childs that dont accept the draggable dont block pro...


Revision: 3108
Author: paul.bakaus
Date: Sat Aug 22 05:25:50 2009
Log: droppable: greedy childs that dont accept the draggable dont block
propagation anymore, fixes #4570
http://code.google.com/p/jquery-ui/source/detail?r=3108
Modified:
/trunk/ui/ui.droppable.js
=======================================
--- /trunk/ui/ui.droppable.js    Sat Aug 22 04:48:48 2009
+++ /trunk/ui/ui.droppable.js    Sat Aug 22 05:25:50 2009
@@ -103,9 +103,13 @@
        var childrenIntersection = false;
        
this.element.find(":data(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;
-            }
+            if(
+                inst.options.greedy
+                && !inst.options.disabled
+                && inst.options.scope == draggable.options.scope
+                && inst.accept.call(inst.element[0], (draggable.currentItem ||
draggable.element))
+                && $.ui.intersect(draggable, $.extend(inst, { offset:
inst.element.offset() }), inst.options.tolerance)
+            ) { childrenIntersection = true; return false; }
        });
        if(childrenIntersection) return false;
@@ -239,7 +243,6 @@
        if(draggable.options.refreshPositions)
$.ui.ddmanager.prepareOffsets(draggable, event);
        //Run through all droppables and check their positions based on specific
tolerance options
-
        $.each($.ui.ddmanager.droppables[draggable.options.scope] || [],
function() {
            if(this.options.disabled || this.greedyChild || !this.visible) return;