aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2009-08-04 23:35:08 +0000
committerScott González <scott.gonzalez@gmail.com>2009-08-04 23:35:08 +0000
commit1a28670720cbc815647d42a045a2fac44c0cd479 (patch)
treeb55d122c4e3a9ba2ecc8ac8df97b9ec6f17fc4fd /ui
parentaacecd6450f005dbc0316d4ef38917ea7aaded09 (diff)
downloadjquery-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.js4
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();
}
},