$.widget: Fixed #3633: Moved call to _init outside of constructor. This makes it possible to invoke callbacks during initialization and have those callbacks use the widget.

This commit is contained in:
Scott González 2009-01-19 01:30:02 +00:00
parent f0aa486bd6
commit 67fb2c8a68

View File

@ -269,7 +269,7 @@ $.widget = function(name, prototype) {
// constructor
(!instance && !isMethodCall &&
$.data(this, name, new $[namespace][name](this, options)));
$.data(this, name, new $[namespace][name](this, options))._init());
// method call
(instance && isMethodCall && $.isFunction(instance[options]) &&
@ -307,8 +307,6 @@ $.widget = function(name, prototype) {
.bind('remove', function() {
return self.destroy();
});
this._init();
};
// add widget prototype