]> source.dussan.org Git - jquery-ui.git/commitdiff
Slider: Changed _trimAlignValue function to return the correct inclusive value betwee...
authorpoplix <poplix@papuasia.org>
Mon, 6 Dec 2010 15:05:46 +0000 (10:05 -0500)
committerScott González <scott.gonzalez@gmail.com>
Mon, 6 Dec 2010 15:05:46 +0000 (10:05 -0500)
ui/jquery.ui.slider.js

index ed27ae9c86cc0ff1247c9c182fd153ab267bf66a..d3b4744e3dcc3f7d0b327290f54a8391a5e3a5d8 100644 (file)
@@ -585,14 +585,14 @@ $.widget( "ui.slider", $.ui.mouse, {
        
        // returns the step-aligned value that val is closest to, between (inclusive) min and max
        _trimAlignValue: function( val ) {
-               if ( val < this._valueMin() ) {
+               if ( val <= this._valueMin() ) {
                        return this._valueMin();
                }
-               if ( val > this._valueMax() ) {
+               if ( val >= this._valueMax() ) {
                        return this._valueMax();
                }
                var step = ( this.options.step > 0 ) ? this.options.step : 1,
-                       valModStep = val % step,
+                       valModStep = (val - this._valueMin()) % step;
                        alignValue = val - valModStep;
 
                if ( Math.abs(valModStep) * 2 >= step ) {