r2322 - Merged r2228 to 1.7.1 (fixes #4315 - Slider: clicking on slider with negative values caus...

r2322 - Merged r2228 to 1.7.1 (fixes #4315 - Slider: clicking on slider with negative values caus...


Author: rdworth
Date: Wed Mar 18 17:26:56 2009
New Revision: 2322
Modified:
branches/1.7.1/ui/ui.slider.js (contents, props changed)
Log:
Merged r2228 to 1.7.1 (fixes #4315 - Slider: clicking on slider with
negative values causes error 'closestHandle is undefined')
Modified: branches/1.7.1/ui/ui.slider.js
==============================================================================
--- branches/1.7.1/ui/ui.slider.js    (original)
+++ branches/1.7.1/ui/ui.slider.js    Wed Mar 18 17:26:56 2009
@@ -193,7 +193,7 @@
        var position = { x: event.pageX, y: event.pageY };
        var normValue = this._normValueFromMouse(position);
-        var distance = this._valueMax() + 1, closestHandle;
+        var distance = this._valueMax() - this._valueMin() + 1, closestHandle;
        var self = this, index;
        this.handles.each(function(i) {
            var thisDistance = Math.abs(normValue - self.values(i));