Skip to content

Commit 930b377

Browse files
committed
Widget: Document how options are handled on init (deep copy except arrays). Fixes #159
1 parent f5c50dd commit 930b377

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

entries/jQuery.widget.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141

4242
<p>We can pass as many or as few options as we want during initialization. Any options that we don't pass will just use their default values.</p>
4343

44+
<p>All options passed on init are deep-copied to ensure the objects can be modified later without affecting the widget. Arrays are the only exception, they are referenced as-is. This exception is in place to support data-binding, where the data source has to be kept as a reference.</p>
45+
4446
<p>The default values are stored on the widget's prototype, therefore we have the ability to override the values that jQuery UI sets. For example, after setting the following, all future progressbar instances will default to a value of 80:</p>
4547

4648
<pre><code>

0 commit comments

Comments
 (0)