From 7f2b0b0db11081eb866a32e5f52a1d5d400c48d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 15 Aug 2008 00:25:50 +0000 Subject: [PATCH] Implemented #3187: Added metadata support to the widget factory. --- ui/ui.core.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(); };