]> source.dussan.org Git - jquery-ui.git/commitdiff
Slider: Refactoring _trimValue method to use more sane programming logic
authorjzaefferer <joern.zaefferer@gmail.com>
Sat, 27 Mar 2010 00:52:44 +0000 (01:52 +0100)
committerjzaefferer <joern.zaefferer@gmail.com>
Sat, 27 Mar 2010 00:52:44 +0000 (01:52 +0100)
ui/jquery.ui.slider.js

index bed4185e77f758821ffd00e701fc90cbcd525320..185fe809c16f31b10f741510501ed2480b33e043 100644 (file)
@@ -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;
        },