Skip to content

Commit 4941198

Browse files
committed
Slider: Refactoring _trimValue method to use more sane programming logic
1 parent b96ff11 commit 4941198

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ui/jquery.ui.slider.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,12 @@ $.widget("ui.slider", $.ui.mouse, {
559559
},
560560

561561
_trimValue: function(val) {
562-
if (val < this._valueMin()) val = this._valueMin();
563-
if (val > this._valueMax()) val = this._valueMax();
564-
562+
if (val < this._valueMin()) {
563+
return this._valueMin();
564+
}
565+
if (val > this._valueMax()) {
566+
return this._valueMax();
567+
}
565568
return val;
566569
},
567570

0 commit comments

Comments
 (0)