aboutsummaryrefslogtreecommitdiffstats
path: root/ui/effects.core.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2009-06-11 13:06:20 +0000
committerScott González <scott.gonzalez@gmail.com>2009-06-11 13:06:20 +0000
commit4175ca180af57cb3c5cd938fb828b2d11404ae43 (patch)
tree5b9a5b92dc5a1fa9f46211e31d479277c51c2bc0 /ui/effects.core.js
parente50d9d3515cd9183803bb7ba365a682db1166953 (diff)
downloadjquery-ui-4175ca180af57cb3c5cd938fb828b2d11404ae43.tar.gz
jquery-ui-4175ca180af57cb3c5cd938fb828b2d11404ae43.zip
Effects core: Refactored .effect() method; now uses _normalizeArguments and honors jQuery.fx.off. Fixes #4328 (IE6 with fx.off and highlight throws a script error).
Diffstat (limited to 'ui/effects.core.js')
-rw-r--r--ui/effects.core.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/ui/effects.core.js b/ui/effects.core.js
index 1db8cb842..a5d8dcb31 100644
--- a/ui/effects.core.js
+++ b/ui/effects.core.js
@@ -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) {