]> source.dussan.org Git - jquery-ui.git/commitdiff
Implemented #3187: Added metadata support to the widget factory.
authorScott González <scott.gonzalez@gmail.com>
Fri, 15 Aug 2008 00:25:50 +0000 (00:25 +0000)
committerScott González <scott.gonzalez@gmail.com>
Fri, 15 Aug 2008 00:25:50 +0000 (00:25 +0000)
ui/ui.core.js

index a0042f6f20bf599fb09d8851e2727da969d702e3..f3d76132a81cf25c82e8699377485cd8a87bebac 100644 (file)
@@ -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();
        };