Changeset 5125
- Timestamp:
- 03/25/08 16:03:15 (10 months ago)
- Files:
-
- 1 modified
-
trunk/ui/ui.droppable.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ui/ui.droppable.js
r5123 r5125 113 113 114 114 var childrenIntersection = false; 115 this.element. children(".ui-droppable").each(function() {115 this.element.find(".ui-droppable").each(function() { 116 116 var inst = $.data(this, 'droppable'); 117 if(inst.options.greedy && $.ui.intersect(draggable, { item: inst, offset: inst.element.offset() }, inst.options.tolerance)) childrenIntersection = true; 117 if(inst.options.greedy && $.ui.intersect(draggable, { item: inst, offset: inst.element.offset() }, inst.options.tolerance)) { 118 childrenIntersection = true; return false; 119 } 118 120 }); 119 121 if(childrenIntersection) return; … … 229 231 $.each($.ui.ddmanager.droppables, function() { 230 232 231 if(this.item. options.disabled) return;233 if(this.item.disabled || this.greedyChild) return; 232 234 var intersects = $.ui.intersect(draggable, this, this.item.options.tolerance); 233 235 234 236 var c = !intersects && this.over == 1 ? 'out' : (intersects && this.over == 0 ? 'over' : null); 235 237 if(!c) return; 236 238 239 var instance = $.data(this.item.element[0], 'droppable'); 240 if (instance.options.greedy) { 241 this.item.element.parents('.ui-droppable').each(function() { 242 var parent = this; 243 $.each($.ui.ddmanager.droppables, function() { 244 if (this.item.element[0] != parent) return; 245 this[c] = 0; 246 this[c == 'out' ? 'over' : 'out'] = 1; 247 this.greedyChild = (c == 'over' ? 1 : 0); 248 this.item[c == 'out' ? 'over' : 'out'].call(this.item, e); 249 return false; 250 }); 251 }); 252 } 253 237 254 this[c] = 1; this[c == 'out' ? 'over' : 'out'] = 0; 238 255 this.item[c].call(this.item, e);
