Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#3857 closed bug (fixed)

toggleClass override breaks new jQuery 1.3 toggleClass state parameter

Reported by: fusioned Owned by:
Priority: critical Milestone: 1.7
Component: ui.effects.core Version: 1.6rc5
Keywords: toggleClass Cc:
Blocked by: Blocking:


jQuery 1.3 brings an extra parameter to toggleClass. However, the effects.core override of this method (effects.core:184) does not take the optional state parameter into account - and instead interprets this as the speed parameter.

This breaks any use of this new parameter over standard jQuery 1.3 usage if the ui effects are included.

One suggestion is that the speed parameter is tested for a boolean type so the old effect behaviour can be kept for those using it, whilst the new 'state' use is passed through correctly.

Change History (3)

comment:1 Changed 14 years ago by fusioned

I made a quick modification for my own use in the effects.core:184-186

toggleClass: function(classNames,speed,easing,callback) {

return (( typeof speed !== "boolean" ) && speed) ? $.effects.animateClass.apply(this, [{ toggle: classNames },speed,easing,callback]) : this._toggleClass(classNames, speed);


Another approach would need to be taken if the animation parameters are to be used alongside the switch parameter.

comment:2 Changed 14 years ago by Cloudream

Resolution: fixed
Status: newclosed

Thanks a lot. [1640]

comment:3 Changed 14 years ago by Cloudream

Milestone: TBD1.6
Note: See TracTickets for help on using tickets.