r3027 committed - Slider: Create a copy of the options.values array for the return value...

r3027 committed - Slider: Create a copy of the options.values array for the return value...


Revision: 3027
Author: scott.gonzalez
Date: Tue Aug 4 16:35:08 2009
Log: 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.
http://code.google.com/p/jquery-ui/source/detail?r=3027
Modified:
/trunk/ui/ui.slider.js
=======================================
--- /trunk/ui/ui.slider.js    Mon Jun 8 17:46:00 2009
+++ /trunk/ui/ui.slider.js    Tue Aug 4 16:35:08 2009
@@ -482,7 +482,9 @@
            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();
        }
    },