mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
droppable: greedy childs that dont accept the draggable dont block propagation anymore, fixes #4570
This commit is contained in:
parent
fefa5bd342
commit
d28166805f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user