diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-06-19 14:45:20 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-06-19 14:45:20 +0200 |
commit | aa7f8195f8c288dbefcb92064b68cb28064ac64c (patch) | |
tree | 333cd184f8a830c1b588e3d3d0368c134648a3b6 /ui/jquery.ui.widget.js | |
parent | 391282a9aeb4e5bb6ba6655d7f1d5d125f93155a (diff) | |
parent | fb210ae1ec16cefb1e4d4dfaf7d55499cac53ab8 (diff) | |
download | jquery-ui-aa7f8195f8c288dbefcb92064b68cb28064ac64c.tar.gz jquery-ui-aa7f8195f8c288dbefcb92064b68cb28064ac64c.zip |
Merge branch 'master' into widget-delegation
Diffstat (limited to 'ui/jquery.ui.widget.js')
-rw-r--r-- | ui/jquery.ui.widget.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index 1c01ef7c9..cf138f774 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -133,7 +133,7 @@ $.widget.bridge = function( name, object ) { } var methodValue = instance[ options ].apply( instance, args ); if ( methodValue !== instance && methodValue !== undefined ) { - returnValue = methodValue.jquery ? + returnValue = methodValue && methodValue.jquery ? returnValue.pushStack( methodValue.get() ) : methodValue; return false; @@ -239,9 +239,6 @@ $.Widget.prototype = { } if ( typeof key === "string" ) { - if ( value === undefined ) { - return this.options[ key ]; - } // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } options = {}; parts = key.split( "." ); @@ -252,8 +249,15 @@ $.Widget.prototype = { curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; curOption = curOption[ parts[ i ] ]; } - curOption[ parts.pop() ] = value; + key = parts.pop(); + if ( value === undefined ) { + return curOption[ key ] === undefined ? null : curOption[ key ]; + } + curOption[ key ] = value; } else { + if ( value === undefined ) { + return this.options[ key ] === undefined ? null : this.options[ key ]; + } options[ key ] = value; } } |