From: jzaefferer Date: Sat, 27 Mar 2010 00:52:44 +0000 (+0100) Subject: Slider: Refactoring _trimValue method to use more sane programming logic X-Git-Tag: 1.8.1~5^2~62^2~12 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=49411982c2ade2f678965b395a56e740a12d049e;p=jquery-ui.git Slider: Refactoring _trimValue method to use more sane programming logic --- diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js index bed4185e7..185fe809c 100644 --- a/ui/jquery.ui.slider.js +++ b/ui/jquery.ui.slider.js @@ -559,9 +559,12 @@ $.widget("ui.slider", $.ui.mouse, { }, _trimValue: function(val) { - if (val < this._valueMin()) val = this._valueMin(); - if (val > this._valueMax()) val = this._valueMax(); - + if (val < this._valueMin()) { + return this._valueMin(); + } + if (val > this._valueMax()) { + return this._valueMax(); + } return val; },