Skip to content
Permalink
Browse files
Slider: Changed _trimAlignValue function to return the correct inclus…
…ive value between min and max. Fixes #6643 - using range and step options makes jquery change min and max.
  • Loading branch information
poplix authored and scottgonzalez committed Dec 6, 2010
1 parent 22cf318 commit 0d0969c
Showing 1 changed file with 3 additions and 3 deletions.
@@ -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 ) {

0 comments on commit 0d0969c

Please sign in to comment.