mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-10-05 01:44:18 +00:00
Fix ui.core to create the $(this).data('component') instance on the "ui-wrapper" element, that is the current "this" inside a $.ui.plugin.add.
This commit is contained in:
parent
9ce9243b83
commit
ebb04981a6
@ -100,11 +100,18 @@ $.widget = function(name, prototype) {
|
||||
}
|
||||
|
||||
return this.each(function() {
|
||||
var instance = $.data(this, name);
|
||||
var instance = $.data(this, name), self = this;
|
||||
|
||||
if (isMethodCall && instance) {
|
||||
instance[options].apply(instance, args);
|
||||
} else if (!isMethodCall) {
|
||||
$.data(this, name, new $[namespace][name](this, options));
|
||||
var instance = new $[namespace][name](this, options), target = instance.element || this;
|
||||
|
||||
if (target.is('.ui-wrapper')) {
|
||||
self = target[0];
|
||||
}
|
||||
|
||||
$.data(self, name, instance);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user