aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2012-10-16 00:15:22 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-10-16 00:17:39 -0400
commitd70e64bff2660cf5a801fe818f1170d5ea93e4fe (patch)
tree613dadf7762a2ecfb90326130eab6e2e1af59ffd
parent6aae3e1038925f8f22d6c0aeedf74f0358890be4 (diff)
downloadjquery-d70e64bff2660cf5a801fe818f1170d5ea93e4fe.tar.gz
jquery-d70e64bff2660cf5a801fe818f1170d5ea93e4fe.zip
fix effects tests failure
-rw-r--r--src/css.js4
-rw-r--r--src/deprecated.js8
-rw-r--r--src/effects.js4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/css.js b/src/css.js
index 99d578873..6f5456315 100644
--- a/src/css.js
+++ b/src/css.js
@@ -116,10 +116,6 @@ jQuery.fn.extend({
toggle: function( state, fn2 ) {
var bool = typeof state === "boolean";
- if ( jQuery.isFunction( state ) && jQuery.isFunction( fn2 ) ) {
- return eventsToggle.apply( this, arguments );
- }
-
return this.each(function() {
if ( bool ? state : isHidden( this ) ) {
jQuery( this ).show();
diff --git a/src/deprecated.js b/src/deprecated.js
index c5fa375d4..241eb2a81 100644
--- a/src/deprecated.js
+++ b/src/deprecated.js
@@ -60,7 +60,13 @@ jQuery.sub = function() {
return jQuerySub;
};
-jQuery.fn.toggle = function( fn ) {
+var oldToggle = jQuery.fn.toggle;
+jQuery.fn.toggle = function( fn, fn2 ) {
+
+ if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) {
+ return oldToggle.apply( this, arguments );
+ }
+
// Save reference to arguments for access in closure
var args = arguments,
guid = fn.guid || jQuery.guid++,
diff --git a/src/effects.js b/src/effects.js
index 3118da407..9965eee78 100644
--- a/src/effects.js
+++ b/src/effects.js
@@ -445,9 +445,7 @@ Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
var cssFn = jQuery.fn[ name ];
jQuery.fn[ name ] = function( speed, easing, callback ) {
- return speed == null || typeof speed === "boolean" ||
- // special check for .toggle( handler, handler, ... )
- ( !i && jQuery.isFunction( speed ) && jQuery.isFunction( easing ) ) ?
+ return speed == null || typeof speed === "boolean" ?
cssFn.apply( this, arguments ) :
this.animate( genFx( name, true ), speed, easing, callback );
};