slider: fixed two failing unit tests

'value method set respects min'
'value method set respects max'
This commit is contained in:
Richard Worth 2009-10-12 09:27:23 +00:00
parent 8072598825
commit 299f20b299

View File

@ -405,6 +405,8 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, {
value: function(newValue) { value: function(newValue) {
if (arguments.length) { 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._setData("value", newValue);
this._change(null, 0); this._change(null, 0);
} }