diff options
author | Scott González <scott.gonzalez@gmail.com> | 2009-08-04 23:35:08 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2009-08-04 23:35:08 +0000 |
commit | 1a28670720cbc815647d42a045a2fac44c0cd479 (patch) | |
tree | b55d122c4e3a9ba2ecc8ac8df97b9ec6f17fc4fd /ui | |
parent | aacecd6450f005dbc0316d4ef38917ea7aaded09 (diff) | |
download | jquery-ui-1a28670720cbc815647d42a045a2fac44c0cd479.tar.gz jquery-ui-1a28670720cbc815647d42a045a2fac44c0cd479.zip |
Slider: Create a copy of the options.values array for the return value of _value(). Fixes #4751 - Dragging slider modifies values, even if callback returns false.
Thanks bkrausz.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/ui.slider.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/ui.slider.js b/ui/ui.slider.js index 1b5a9c5ac..7c603c624 100644 --- a/ui/ui.slider.js +++ b/ui/ui.slider.js @@ -482,7 +482,9 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, { return val; } else { - return this.options.values; + // .slice() creates a copy of the array + // this prevents outside manipulation of the internal state + return this.options.values.slice(); } }, |