vendor/assets/javascripts/semantic-ui/modules/behavior/api.js in semantic-ui-rails-0.6.5 vs vendor/assets/javascripts/semantic-ui/modules/behavior/api.js in semantic-ui-rails-0.7.2

- old
+ new

@@ -45,11 +45,11 @@ query = arguments[0], methodInvoked = (instance !== undefined && typeof query == 'string'), queryArguments = [].slice.call(arguments, 1), module, - invokedResponse + returnedValue ; module = { initialize: function() { var @@ -348,31 +348,27 @@ .removeClass(className.loading) ; }, setting: function(name, value) { - if(value !== undefined) { - if( $.isPlainObject(name) ) { - $.extend(true, settings, name); - } - else { - settings[name] = value; - } + if( $.isPlainObject(name) ) { + $.extend(true, settings, name); } + else if(value !== undefined) { + settings[name] = value; + } else { return settings[name]; } }, internal: function(name, value) { - if(value !== undefined) { - if( $.isPlainObject(name) ) { - $.extend(true, module, name); - } - else { - module[name] = value; - } + if( $.isPlainObject(name) ) { + $.extend(true, module, name); } + else if(value !== undefined) { + module[name] = value; + } else { return module[name]; } }, debug: function() { @@ -492,18 +488,18 @@ response = found.apply(context, passedArguments); } else if(found !== undefined) { response = found; } - if($.isArray(invokedResponse)) { - invokedResponse.push(response); + if($.isArray(returnedValue)) { + returnedValue.push(response); } - else if(typeof invokedResponse == 'string') { - invokedResponse = [invokedResponse, response]; + else if(returnedValue !== undefined) { + returnedValue = [returnedValue, response]; } else if(response !== undefined) { - invokedResponse = response; + returnedValue = response; } return found; } }; @@ -518,11 +514,11 @@ module.destroy(); } module.initialize(); } - return (invokedResponse !== undefined) - ? invokedResponse + return (returnedValue !== undefined) + ? returnedValue : this ; }; // handle DOM attachment to API functionality \ No newline at end of file