diff options
Diffstat (limited to 'ui/slider.js')
-rw-r--r-- | ui/slider.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ui/slider.js b/ui/slider.js index 74cbcc759..6d97f3c69 100644 --- a/ui/slider.js +++ b/ui/slider.js @@ -58,6 +58,7 @@ return $.widget( "ui.slider", $.ui.mouse, { this._handleIndex = null; this._detectOrientation(); this._mouseInit(); + this._calculateNewMax(); this.element .addClass( "ui-slider" + @@ -472,9 +473,11 @@ return $.widget( "ui.slider", $.ui.mouse, { } this._animateOff = false; break; + case "step": case "min": case "max": this._animateOff = true; + this._calculateNewMax(); this._refreshValue(); this._animateOff = false; break; @@ -543,12 +546,17 @@ return $.widget( "ui.slider", $.ui.mouse, { return parseFloat( alignValue.toFixed(5) ); }, + _calculateNewMax: function() { + var remainder = ( this.options.max - this._valueMin() ) % this.options.step; + this.max = this.options.max - remainder; + }, + _valueMin: function() { return this.options.min; }, _valueMax: function() { - return this.options.max; + return this.max; }, _refreshValue: function() { |