diff options
author | Scott González <scott.gonzalez@gmail.com> | 2010-10-06 15:11:49 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2010-10-06 15:11:49 -0400 |
commit | 512825d358851f4b2b584f1b6463e9cd48f31752 (patch) | |
tree | 4953644ceec329dc6522dd75925e3ddd844424e3 /tests/unit/widget | |
parent | c3b282fceb8b5161c013575bf01c652d6573d72e (diff) | |
download | jquery-ui-512825d358851f4b2b584f1b6463e9cd48f31752.tar.gz jquery-ui-512825d358851f4b2b584f1b6463e9cd48f31752.zip |
Widget: Added ability to define how to find options on init. Fixes #6158 - Widget: Ability to define new methods for gathering options on init.
Diffstat (limited to 'tests/unit/widget')
-rw-r--r-- | tests/unit/widget/widget_core.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js index 364838e3f..2673350f3 100644 --- a/tests/unit/widget/widget_core.js +++ b/tests/unit/widget/widget_core.js @@ -156,6 +156,32 @@ test("merge multiple option arguments", function() { }); }); +test( "_getCreateOptions()", function() { + expect( 1 ); + $.widget( "ui.testWidget", { + options: { + option1: "valuex", + option2: "valuex", + option3: "value3", + }, + _getCreateOptions: function() { + return { + option1: "override1", + option2: "overideX", + }; + }, + _create: function() { + same( this.options, { + disabled: false, + option1: "override1", + option2: "value2", + option3: "value3" + }); + } + }); + $( "<div>" ).testWidget({ option2: "value2" }); +}); + test( "re-init", function() { var div = $( "<div></div>" ), actions = []; |