]> source.dussan.org Git - jquery-ui.git/commitdiff
Slider: Create a copy of the options.values array for the return value of _value...
authorScott González <scott.gonzalez@gmail.com>
Tue, 4 Aug 2009 23:35:08 +0000 (23:35 +0000)
committerScott González <scott.gonzalez@gmail.com>
Tue, 4 Aug 2009 23:35:08 +0000 (23:35 +0000)
Thanks bkrausz.

ui/ui.slider.js

index 1b5a9c5ac9afd052322004f518dc5770bb1182ee..7c603c624de6f081b38790b46619cb563f9b8aa2 100644 (file)
@@ -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();
                }
 
        },