Search and Top Navigation
Ticket #4722: 4722.patch
File 4722.patch, 1.0 KB (added by Cloudream, July 27, 2009 09:20AM UTC)
Index: effects.core.js
===================================================================
--- effects.core.js (�汾 2991)
+++ effects.core.js (��������)
@@ -222,8 +222,18 @@
},
_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) {
Download in other formats:
Original Format
File 4722.patch, 1.0 KB (added by Cloudream, July 27, 2009 09:20AM UTC)
Index: effects.core.js
===================================================================
--- effects.core.js (�汾 2991)
+++ effects.core.js (��������)
@@ -222,8 +222,18 @@
},
_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) {