Search and Top Navigation
Ticket #4570: greedyDropBadScope.diff
File greedyDropBadScope.diff, 1.2 KB (added by rbrackett, June 01, 2009 11:29PM UTC)
Index: ui/ui.droppable.js
===================================================================
--- ui/ui.droppable.js (revision 2636)
+++ ui/ui.droppable.js (working copy)
@@ -103,7 +103,7 @@
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)) {
+ if(inst.options.greedy && inst.options.scope === draggable.options.scope && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
childrenIntersection = true; return false;
}
});
@@ -251,7 +251,10 @@
var parentInstance;
if (this.options.greedy) {
- var parent = this.element.parents(':data(droppable):eq(0)');
+ var drop = this;
+ var parent = this.element.parents(':data(droppable):eq(0)').filter(function() {
+ return ($.data(this, "droppable").option("scope") === drop.options.scope);
+ });
if (parent.length) {
parentInstance = $.data(parent[0], 'droppable');
parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
Download in other formats:
Original Format
File greedyDropBadScope.diff, 1.2 KB (added by rbrackett, June 01, 2009 11:29PM UTC)
Index: ui/ui.droppable.js
===================================================================
--- ui/ui.droppable.js (revision 2636)
+++ ui/ui.droppable.js (working copy)
@@ -103,7 +103,7 @@
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)) {
+ if(inst.options.greedy && inst.options.scope === draggable.options.scope && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
childrenIntersection = true; return false;
}
});
@@ -251,7 +251,10 @@
var parentInstance;
if (this.options.greedy) {
- var parent = this.element.parents(':data(droppable):eq(0)');
+ var drop = this;
+ var parent = this.element.parents(':data(droppable):eq(0)').filter(function() {
+ return ($.data(this, "droppable").option("scope") === drop.options.scope);
+ });
if (parent.length) {
parentInstance = $.data(parent[0], 'droppable');
parentInstance.greedyChild = (c == 'isover' ? 1 : 0);