mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Implemented #3187: Added metadata support to the widget factory.
This commit is contained in:
parent
b89bb4b160
commit
7f2b0b0db1
@ -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();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user