]> source.dussan.org Git - jquery-ui.git/commitdiff
Effects core: Properly handle defaults for effects that are called with a single...
authorScott González <scott.gonzalez@gmail.com>
Tue, 3 Apr 2012 02:35:42 +0000 (22:35 -0400)
committerScott González <scott.gonzalez@gmail.com>
Tue, 3 Apr 2012 02:35:42 +0000 (22:35 -0400)
ui/jquery.effects.core.js

index 1d56ae62fb4bb347720edbfa019d5745581acc90..626ab1a89b2b5a617866102d5aff76f674ef59e6 100644 (file)
@@ -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 = {};