diff options
author | Paul Bakaus <paul.bakaus@googlemail.com> | 2009-08-22 12:25:50 +0000 |
---|---|---|
committer | Paul Bakaus <paul.bakaus@googlemail.com> | 2009-08-22 12:25:50 +0000 |
commit | d28166805f72de1f76dcbc322e5c79ec50791882 (patch) | |
tree | 185ab8a6c18066255028bc93f15b17434cae8f89 | |
parent | fefa5bd34208de9b80c6275515a00ba551d76040 (diff) | |
download | jquery-ui-d28166805f72de1f76dcbc322e5c79ec50791882.tar.gz jquery-ui-d28166805f72de1f76dcbc322e5c79ec50791882.zip |
droppable: greedy childs that dont accept the draggable dont block propagation anymore, fixes #4570
-rw-r--r-- | ui/ui.droppable.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/ui.droppable.js b/ui/ui.droppable.js index 7966ae3b0..4c359799c 100644 --- a/ui/ui.droppable.js +++ b/ui/ui.droppable.js @@ -103,9 +103,13 @@ $.widget("ui.droppable", { 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 @@ $.ui.ddmanager = { 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; |