mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-10-05 01:44:18 +00:00
$.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:
parent
f0aa486bd6
commit
67fb2c8a68
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user