]> source.dussan.org Git - jquery-ui.git/commitdiff
slider: fixed two failing unit tests
authorRichard Worth <rdworth@gmail.com>
Mon, 12 Oct 2009 09:27:23 +0000 (09:27 +0000)
committerRichard Worth <rdworth@gmail.com>
Mon, 12 Oct 2009 09:27:23 +0000 (09:27 +0000)
'value method set respects min'
'value method set respects max'

ui/jquery.ui.slider.js

index ca2dad2eb646c145a49715a9362f3328a93a3076..84dc9633c1971cd4763a8b942106ffbd67958435 100644 (file)
@@ -405,6 +405,8 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, {
        value: function(newValue) {
 
                if (arguments.length) {
+                       newValue = newValue >= this.options.min ? newValue : this.options.min;
+                       newValue = newValue <= this.options.max ? newValue : this.options.max;
                        this._setData("value", newValue);
                        this._change(null, 0);
                }