Skip to main content

Search and Top Navigation

Ticket #3948: jquery.ui-closestHandle.patch


File jquery.ui-closestHandle.patch, 0.6 KB (added by op, January 26, 2009 05:01PM UTC)

Fix for the problem

--- ui.orig/ui.slider.js	2009-01-16 01:11:14.000000000 +0100
+++ ui/ui.slider.js	2009-01-26 17:59:35.490771400 +0100
@@ -185,7 +185,8 @@
 		var position = { x: event.pageX, y: event.pageY };
 		var normValue = this._normValueFromMouse(position);
 
-		var distance = this._valueMax(), closestHandle;
+		var distance = this._valueMax() + 1;
+		var closestHandle;
 		var self = this, index;
 		this.handles.each(function(i) {
 			var thisDistance = Math.abs(normValue - self.values(i));
@@ -196,6 +197,9 @@
 			}
 		});
 
+		if (index == undefined)
+			return false;
+
 		self._handleIndex = index;
 
 		closestHandle

Download in other formats:

Original Format