Widget factory: Make methods chainable if the return value is undefined. Fixed #4601 (Allow undefined return value for chainable method calls).

This commit is contained in:
Scott González 2009-06-15 02:01:11 +00:00
parent d8d7cf27c3
commit 58b37be5ac

View File

@ -244,7 +244,7 @@ $.widget = function(name, prototype) {
methodValue = (instance && $.isFunction(instance[options]) methodValue = (instance && $.isFunction(instance[options])
? instance[options].apply(instance, args) ? instance[options].apply(instance, args)
: instance); : instance);
if (methodValue !== instance) { if (methodValue !== instance && methodValue !== undefined) {
returnValue = methodValue; returnValue = methodValue;
return false; return false;
} }