Skip to content
Permalink
Browse files

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.
  • Loading branch information
eduardolundgren committed Jun 6, 2008
1 parent 9ce9243 commit ebb04981a68445ad4bf302818b02e21940d41c25
Showing with 9 additions and 2 deletions.
  1. +9 −2 ui/source/ui.core.js
@@ -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);
}
});
};

0 comments on commit ebb0498

Please sign in to comment.
You can’t perform that action at this time.