]> source.dussan.org Git - jquery-ui.git/commitdiff
Effects core: Refactored .effect() method; now uses _normalizeArguments and honors...
authorScott González <scott.gonzalez@gmail.com>
Thu, 11 Jun 2009 13:06:20 +0000 (13:06 +0000)
committerScott González <scott.gonzalez@gmail.com>
Thu, 11 Jun 2009 13:06:20 +0000 (13:06 +0000)
ui/effects.core.js

index 1db8cb8426d6f1fb231a8a5ee33126915cafe2ba..a5d8dcb31f6e2a986692af66d57e0d20ddb7090f 100644 (file)
@@ -167,8 +167,17 @@ $.fn.extend({
        _toggleClass: $.fn.toggleClass,
 
        // New effect methods
-       effect: function(fx, options, speed, callback) {
-               return $.effects[fx] ? $.effects[fx].call(this, {method: fx, options: options || {}, duration: speed, callback: callback }) : null;
+       effect: function(effect, options, speed, callback) {
+               var args = _normalizeArguments.apply(this, arguments),
+                       // TODO: make effects takes actual parameters instead of a hash
+                       args2 = {
+                               options: args[1],
+                               duration: args[2],
+                               callback: args[3]
+                       },
+                       effectMethod = $.effects[effect];
+               
+               return effectMethod && !$.fx.off ? effectMethod.call(this, args2) : this;
        },
 
        show: function(speed) {