Skip to main content

Bug Tracker

Side navigation

Ticket #2417: sortable.patch
File sortable.patch, 1.2 KB (added by jr, February 26, 2008 06:26PM UTC)

patch

Index: ui/ui.sortable.js
===================================================================
--- ui/ui.sortable.js	(revision 4835)
+++ ui/ui.sortable.js	(working copy)
@@ -77,7 +77,7 @@
 
 				//Find out if the clicked node (or one of its parents) is a actual item in this.items
 				var currentItem = null, nodes = $(e.target).parents().andSelf().each(function() {
-					if($.data(this, 'ui-sortable-item')) currentItem = $(this);
+					if($.data(this, 'ui-sortable-item') === self) currentItem = $(this);
 				});
 				if(currentItem && (!this.options.handle || $(e.target).parents().andSelf().is(this.options.handle))) {
 					this.currentItem = currentItem;
@@ -149,6 +149,7 @@
 		},
 		refresh: function() {
 			
+			var self = this;
 			this.items = [];
 			this.containers = [this];
 			var items = this.items;
@@ -171,7 +172,7 @@
 
 			for (var i = queries.length - 1; i >= 0; i--){
 				queries[i].each(function() {
-					$.data(this, 'ui-sortable-item', true); // Data for target checking (mouse manager)
+					$.data(this, 'ui-sortable-item', self); // Data for target checking (mouse manager)
 					items.push({
 						item: $(this),
 						width: 0, height: 0,
@@ -393,4 +394,4 @@
 		}
 	});

Download in other formats:

Original Format