stickman’s accordian.js and prototype 1.6.0 not playing well together

yesterday i was having some issues with accordian.js and the latest greatest version of prototype. everything worked fine and dandy with prototype 1.5.1.1, but i was having problems with ‘too much recursion’ errors while using Effects.DropOut from scriptaculous’ effects.js. so… i decided to upgrade to prototype 1.6.0, and that’s when the accordian broke. :*(

 

turns out that prototype has made some changes that were not backwards compatible with the $H (hash) class. following a comment poster’s suggestion on stickman’s site, i removed all references to $H from accordian.js as well as all of the references to options.merge and changed to the following:

 

old:
var options = $H({height: ‘0px’});

options.merge({display: ‘none’});

 

new:

var options = {height: ‘0px’};

Object.extend(options, {display: ‘none’});

 

this seems to have resolved the issue.

Also to note is a change that was made in 1.6.0 for creating superclasses using Class.create(). Of course… this change is a bit more graceful, as it seems that the legacy way of doing this still works.

 

 

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Pownce
  • Technorati
  • TwitThis
  • De.lirio.us
  • E-mail this story to a friend!
  • Fark
  • LinkedIn
  • Slashdot
  • Socialogs
  • StumbleUpon

5 Responses to “stickman’s accordian.js and prototype 1.6.0 not playing well together”

  1. Chris Says:

    I haven’t had much luck with this change. Would there be any chance you could post you changes somewhere?

  2. Jim Says:

    Sure! Here you go:

    http://www.jimrising.com/assets/code/js/accordion_fixed.js

  3. douglas Says:

    Jim,

    Thanks!!!!!! This was giving me a fit, and I had already developed a huge amount of work around the 1.6.

  4. Jim Says:

    hey… no problem. glad it was useful!

  5. Cosmin Says:

    Thanks,

    Just stumbled on your post. It was very usefull.

Leave a Reply

You must be logged in to post a comment.