Ticket #3857 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

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:
Blocking: Blocked by:

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.

Change History

comment:1 Changed 6 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 6 years ago by Cloudream

  • Status changed from new to closed
  • Resolution set to fixed

Thanks a lot. [1640]

comment:3 Changed 6 years ago by Cloudream

  • Milestone changed from TBD to 1.6
Note: See TracTickets for help on using tickets.