From 67fb2c8a68123373a8fffa9d71e4af5ce2e6dc23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 19 Jan 2009 01:30:02 +0000 Subject: [PATCH] $.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. --- ui/ui.core.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ui/ui.core.js b/ui/ui.core.js index 458857d14..7185ee38e 100644 --- a/ui/ui.core.js +++ b/ui/ui.core.js @@ -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