mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Effects: handle switch parameter in toggleClass, fixes #4722
This commit is contained in:
parent
f35bae5a7f
commit
010a225af3
@ -222,8 +222,18 @@ $.fn.extend({
|
||||
},
|
||||
|
||||
_toggleClass: $.fn.toggleClass,
|
||||
toggleClass: function(classNames,speed,easing,callback) {
|
||||
return ( (typeof speed !== "boolean") && speed ) ? $.effects.animateClass.apply(this, [{ toggle: classNames },speed,easing,callback]) : this._toggleClass(classNames, speed);
|
||||
toggleClass: function(classNames, force, speed, easing, callback) {
|
||||
if ( typeof force == "boolean" || force === undefined ) {
|
||||
if ( !speed ) {
|
||||
// without speed parameter;
|
||||
return this._toggleClass(classNames, force);
|
||||
} else {
|
||||
return $.effects.animateClass.apply(this, [(force?{add:classNames}:{remove:classNames}),speed,easing,callback]);
|
||||
}
|
||||
} else {
|
||||
// without switch parameter;
|
||||
return $.effects.animateClass.apply(this, [{ toggle: classNames },force,speed,easing]);
|
||||
}
|
||||
},
|
||||
|
||||
switchClass: function(remove,add,speed,easing,callback) {
|
||||
|
Loading…
Reference in New Issue
Block a user