mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
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.
This commit is contained in:
parent
22cf318e40
commit
0d0969ca2b
6
ui/jquery.ui.slider.js
vendored
6
ui/jquery.ui.slider.js
vendored
@ -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 ) {
|
||||
|
Loading…
Reference in New Issue
Block a user