diff options
author | poplix <poplix@papuasia.org> | 2010-12-06 10:05:46 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2010-12-06 10:05:46 -0500 |
commit | 0d0969ca2b6ad5c8937313cc3868d8a21335d748 (patch) | |
tree | ad0a0d121ca359242d039db560e8036d0b2451cd | |
parent | 22cf318e40e0ee1996ac27d8877ef2ec19e84ca2 (diff) | |
download | jquery-ui-0d0969ca2b6ad5c8937313cc3868d8a21335d748.tar.gz jquery-ui-0d0969ca2b6ad5c8937313cc3868d8a21335d748.zip |
Slider: Changed _trimAlignValue function to return the correct inclusive value between min and max. Fixes #6643 - using range and step options makes jquery change min and max.
-rw-r--r-- | ui/jquery.ui.slider.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js index ed27ae9c8..d3b4744e3 100644 --- a/ui/jquery.ui.slider.js +++ b/ui/jquery.ui.slider.js @@ -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 ) { |