]> source.dussan.org Git - jquery-ui.git/commitdiff
Effects Core: Proper handling for .toggle(true). Fixes #4473 - effects.core corrupts...
authorScott González <scott.gonzalez@gmail.com>
Sun, 19 Apr 2009 21:19:23 +0000 (21:19 +0000)
committerScott González <scott.gonzalez@gmail.com>
Sun, 19 Apr 2009 21:19:23 +0000 (21:19 +0000)
ui/effects.core.js

index 8313cd29b68543063291299ff72fdb1ab07d710e..e4f3dc118a7e8b08c04fe14b91a53bf44fb785dd 100644 (file)
@@ -175,9 +175,11 @@ $.fn.extend({
        },
 
        toggle: function(){
-               if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])) || (arguments[0].constructor == Function))
+               if(!arguments[0] ||
+                       (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])) ||
+                       ($.isFunction(arguments[0]) || typeof arguments[0] == 'boolean')) {
                        return this.__toggle.apply(this, arguments);
-               else {
+               else {
                        return this.effect.apply(this, _normalizeArguments(arguments, 'toggle'));
                }
        },