mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
fix effects tests failure
This commit is contained in:
parent
6aae3e1038
commit
d70e64bff2
@ -116,10 +116,6 @@ jQuery.fn.extend({
|
|||||||
toggle: function( state, fn2 ) {
|
toggle: function( state, fn2 ) {
|
||||||
var bool = typeof state === "boolean";
|
var bool = typeof state === "boolean";
|
||||||
|
|
||||||
if ( jQuery.isFunction( state ) && jQuery.isFunction( fn2 ) ) {
|
|
||||||
return eventsToggle.apply( this, arguments );
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.each(function() {
|
return this.each(function() {
|
||||||
if ( bool ? state : isHidden( this ) ) {
|
if ( bool ? state : isHidden( this ) ) {
|
||||||
jQuery( this ).show();
|
jQuery( this ).show();
|
||||||
|
@ -60,7 +60,13 @@ jQuery.sub = function() {
|
|||||||
return jQuerySub;
|
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
|
// Save reference to arguments for access in closure
|
||||||
var args = arguments,
|
var args = arguments,
|
||||||
guid = fn.guid || jQuery.guid++,
|
guid = fn.guid || jQuery.guid++,
|
||||||
|
4
src/effects.js
vendored
4
src/effects.js
vendored
@ -445,9 +445,7 @@ Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
|
|||||||
jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
|
jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
|
||||||
var cssFn = jQuery.fn[ name ];
|
var cssFn = jQuery.fn[ name ];
|
||||||
jQuery.fn[ name ] = function( speed, easing, callback ) {
|
jQuery.fn[ name ] = function( speed, easing, callback ) {
|
||||||
return speed == null || typeof speed === "boolean" ||
|
return speed == null || typeof speed === "boolean" ?
|
||||||
// special check for .toggle( handler, handler, ... )
|
|
||||||
( !i && jQuery.isFunction( speed ) && jQuery.isFunction( easing ) ) ?
|
|
||||||
cssFn.apply( this, arguments ) :
|
cssFn.apply( this, arguments ) :
|
||||||
this.animate( genFx( name, true ), speed, easing, callback );
|
this.animate( genFx( name, true ), speed, easing, callback );
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user