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 /ui/jquery.ui.widget.js | |
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 'ui/jquery.ui.widget.js')
-rw-r--r-- | ui/jquery.ui.widget.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index bc6408125..f41f9637a 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -145,7 +145,7 @@ $.Widget.prototype = { this.element = $( element ); this.options = $.extend( true, {}, this.options, - $.metadata && $.metadata.get( element )[ this.widgetName ], + this._getCreateOptions(), options ); var self = this; @@ -157,6 +157,13 @@ $.Widget.prototype = { this._trigger( "create" ); this._init(); }, + _getCreateOptions: function() { + var options = {}; + if ( $.metadata ) { + options = $.metadata.get( element )[ this.widgetName ]; + } + return options; + }, _create: function() {}, _init: function() {}, |