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);
.bind('remove', function() {
return self.destroy();
});
+
this.init();
};