Skip to content
Permalink
Browse files

Widget factory: fixed #2981: Graceful handling of method calls on uni…

…nitialized plugins.
  • Loading branch information
scottgonzalez committed Jun 4, 2008
1 parent 126d7d9 commit 2b1bd34cef6a5e80555b5ff82acd8ddc25d6d3b3
Showing with 3 additions and 3 deletions.
  1. +3 −3 ui/source/ui.core.js
@@ -101,10 +101,10 @@ $.widget = function(name, prototype) {

return this.each(function() {
var instance = $.data(this, name);
if (!instance) {
$.data(this, name, new $[namespace][name](this, options));
} else if (isMethodCall) {
if (isMethodCall && instance) {
instance[options].apply(instance, args);
} else if (!isMethodCall) {
$.data(this, name, new $[namespace][name](this, options));
}
});
};

0 comments on commit 2b1bd34

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