mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-10-05 01:44:18 +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() {
|
return this.each(function() {
|
||||||
var instance = $.data(this, name);
|
var instance = $.data(this, name);
|
||||||
if (isMethodCall && instance) {
|
if (isMethodCall && instance && $.isFunction(instance[options])) {
|
||||||
instance[options].apply(instance, args);
|
instance[options].apply(instance, args);
|
||||||
} else if (!isMethodCall) {
|
} else if (!isMethodCall) {
|
||||||
$.data(this, name, new $[namespace][name](this, options));
|
$.data(this, name, new $[namespace][name](this, options));
|
||||||
|
Loading…
Reference in New Issue
Block a user