From: Scott González Date: Tue, 3 Apr 2012 02:35:42 +0000 (-0400) Subject: Effects core: Properly handle defaults for effects that are called with a single... X-Git-Tag: 1.9.0m8~160 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0624c74929b60104cfcdd2463619e903fcfd0792;p=jquery-ui.git Effects core: Properly handle defaults for effects that are called with a single hash. --- diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js index 1d56ae62f..626ab1a89 100644 --- a/ui/jquery.effects.core.js +++ b/ui/jquery.effects.core.js @@ -497,9 +497,10 @@ $.extend( $.effects, { // return an effect options object for the given parameters: function _normalizeArguments( effect, options, speed, callback ) { - // short path for passing an effect options object: + // allow passing all optinos as the first parameter if ( $.isPlainObject( effect ) ) { - return effect; + options = effect; + effect = effect.effect; } // convert to an object @@ -518,7 +519,7 @@ function _normalizeArguments( effect, options, speed, callback ) { } // catch (effect, speed, ?) - if ( $.type( options ) === "number" || $.fx.speeds[ options ]) { + if ( typeof options === "number" || $.fx.speeds[ options ] ) { callback = speed; speed = options; options = {};