aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.widget.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-09-27 11:21:09 -0400
committerScott González <scott.gonzalez@gmail.com>2010-09-27 11:21:09 -0400
commit9d88b565d6f65dc1aaebfaf99699f6155370949c (patch)
treef40b589e75d7c57c1214b43dff0f8283bf20685a /ui/jquery.ui.widget.js
parent0b6710aed7fc9a9412a975c9f70d3fd6a87c4b02 (diff)
downloadjquery-ui-9d88b565d6f65dc1aaebfaf99699f6155370949c.tar.gz
jquery-ui-9d88b565d6f65dc1aaebfaf99699f6155370949c.zip
Widget: Added _setOptions method for handling normalized options setting. Fixes #6114 - Widget: Add _setOptions() method.
Diffstat (limited to 'ui/jquery.ui.widget.js')
-rw-r--r--ui/jquery.ui.widget.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js
index aef9b8378..866f7441e 100644
--- a/ui/jquery.ui.widget.js
+++ b/ui/jquery.ui.widget.js
@@ -176,12 +176,11 @@ $.Widget.prototype = {
},
option: function( key, value ) {
- var options = key,
- self = this;
+ var options = key;
if ( arguments.length === 0 ) {
// don't return a reference to the internal hash
- return $.extend( {}, self.options );
+ return $.extend( {}, this.options );
}
if (typeof key === "string" ) {
@@ -192,11 +191,17 @@ $.Widget.prototype = {
options[ key ] = value;
}
+ this._setOptions( options );
+
+ return this;
+ },
+ _setOptions: function( options ) {
+ var self = this;
$.each( options, function( key, value ) {
self._setOption( key, value );
});
- return self;
+ return this;
},
_setOption: function( key, value ) {
this.options[ key ] = value;