Skip to main content

Search and Top Navigation

#3857 closed bug (fixed)

Opened January 16, 2009 04:05PM UTC

Closed January 16, 2009 04:55PM UTC

Last modified January 16, 2009 04:55PM UTC

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:
Description

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.

Attachments (0)
Change History (3)

Changed January 16, 2009 04:15PM UTC by fusioned comment:1

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.

Changed January 16, 2009 04:55PM UTC by Cloudream comment:2

resolution: → fixed
status: newclosed

Thanks a lot. [1640]

Changed January 16, 2009 04:55PM UTC by Cloudream comment:3

milestone: TBD1.6