aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2008-08-15 00:25:50 +0000
committerScott González <scott.gonzalez@gmail.com>2008-08-15 00:25:50 +0000
commit7f2b0b0db11081eb866a32e5f52a1d5d400c48d7 (patch)
tree2249aa0f304bc34abf59418196a49d79d825863a
parentb89bb4b1605dc6aeb3c0f0e0e4bfd1b518e7b4ca (diff)
downloadjquery-ui-7f2b0b0db11081eb866a32e5f52a1d5d400c48d7.tar.gz
jquery-ui-7f2b0b0db11081eb866a32e5f52a1d5d400c48d7.zip
Implemented #3187: Added metadata support to the widget factory.
-rw-r--r--ui/ui.core.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/ui.core.js b/ui/ui.core.js
index a0042f6f2..f3d76132a 100644
--- a/ui/ui.core.js
+++ b/ui/ui.core.js
@@ -124,7 +124,12 @@ $.widget = function(name, prototype) {
this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
this.widgetBaseClass = namespace + '-' + name;
- this.options = $.extend({}, $.widget.defaults, $[namespace][name].defaults, options);
+ this.options = $.extend({},
+ $.widget.defaults,
+ $[namespace][name].defaults,
+ $.metadata && $.metadata.get(element)[name],
+ options);
+
this.element = $(element)
.bind('setData.' + name, function(e, key, value) {
return self.setData(key, value);
@@ -135,6 +140,7 @@ $.widget = function(name, prototype) {
.bind('remove', function() {
return self.destroy();
});
+
this.init();
};