r3159 committed - Widget factory: Added support for deep extending multiple option hashe...

r3159 committed - Widget factory: Added support for deep extending multiple option hashe...


Revision: 3159
Author: scott.gonzalez
Date: Thu Aug 27 17:39:43 2009
Log: Widget factory: Added support for deep extending multiple option
hashes on init.
http://code.google.com/p/jquery-ui/source/detail?r=3159
Modified:
/trunk/tests/unit/core/core.js
/trunk/ui/ui.core.js
=======================================
--- /trunk/tests/unit/core/core.js    Tue Aug 25 19:06:19 2009
+++ /trunk/tests/unit/core/core.js    Thu Aug 27 17:39:43 2009
@@ -65,17 +65,31 @@
                disabled: false,
                option1: "value1",
                option2: "value2",
-                option3: "value3"
+                option3: "value3",
+                option4: {
+                    option4a: "valuea",
+                    option4b: "valueb"
+                }
            });
        }
    });
    $("#main > :first").widgetTest({
        option1: "valuex",
        option2: "valuex",
-        option3: "value3"
+        option3: "value3",
+        option4: {
+            option4a: "valuex"
+        }
    }, {
        option1: "value1",
-        option2: "value2"
+        option2: "value2",
+        option4: {
+            option4b: "valueb"
+        }
+    }, {
+        option4: {
+            option4a: "valuea"
+        }
    });
});
=======================================
--- /trunk/ui/ui.core.js    Tue Aug 25 19:06:19 2009
+++ /trunk/ui/ui.core.js    Thu Aug 27 17:39:43 2009
@@ -255,7 +255,7 @@
        // allow multiple hashes to be passed on init
        options = !isMethodCall && args.length
-            ? $.extend.apply(null, arguments)
+            ? $.extend.apply(null, [true, options].concat(args))
            : options;
        // prevent calls to internal methods