Skip to main content

Bug Tracker

Side navigation

Ticket #2063: uidraggable121607.patch
File uidraggable121607.patch, 1.2 KB (added by mnichols, December 17, 2007 06:57AM UTC)

Draggable using 'call' for accept callback

Index: ui.draggable.js
===================================================================
--- ui.draggable.js	(revision 4200)
+++ ui.draggable.js	(working copy)
@@ -33,8 +33,8 @@
 			var m = $.ui.ddmanager.droppables;
 			for (var i = 0; i < m.length; i++) {
 				if(m[i].item.disabled) continue;
-				m[i].offset = $(m[i].item.element).offset();
-				if (t && m[i].item.options.accept(t.element)) //Activate the droppable if used directly from draggables
+				m[i].offset = $(m[i].item.element).offset();				
+				if (t && m[i].item.options.accept.call(m[i].item,t)) //Activate the droppable if used directly from draggables
 					m[i].item.activate.call(m[i].item, e);
 			}
 		},
@@ -45,8 +45,8 @@
 				if (!!oDrop && !oDrop.item.disabled && $.ui.intersect(oDrag, oDrop, oDrop.item.options.tolerance))
 					oDrop.item.drop.call(oDrop.item, e);
 			});
-			$.each(oDrops, function(i, oDrop) {
-				if (!oDrop.item.disabled && oDrop.item.options.accept(oDrag.element)) {
+			$.each(oDrops, function(i, oDrop) {			    
+				if (!oDrop.item.disabled && oDrop.item.options.accept.call(oDrop.item,oDrag)) {
 					oDrop.out = 1; oDrop.over = 0;
 					oDrop.item.deactivate.call(oDrop.item, e);
 				}

Download in other formats:

Original Format