mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
core widget - fail gracefully if unknown method name supplied
This commit is contained in:
parent
7539a095f6
commit
e23a0edb70
@ -101,7 +101,7 @@ $.widget = function(name, prototype) {
|
||||
|
||||
return this.each(function() {
|
||||
var instance = $.data(this, name);
|
||||
if (isMethodCall && instance) {
|
||||
if (isMethodCall && instance && $.isFunction(instance[options])) {
|
||||
instance[options].apply(instance, args);
|
||||
} else if (!isMethodCall) {
|
||||
$.data(this, name, new $[namespace][name](this, options));
|
||||
|
Loading…
Reference in New Issue
Block a user