rem:  if (fieldset.animating) { return false; } fieldset.animating = true;  if ($(fieldset).is('.collapsed')) {  $(fieldset.contentWrapper).hide(); $(fieldset).removeClass('collapsed'); $(fieldset.contentWrapper).slideDown(300, {  complete: function() { $(fieldset.contentWrapper).css('height', 'auto'); Drupal.collapseScrollIntoView(fieldset); fieldset.animating = false; },  step: function() { Drupal.collapseScrollIntoView(fieldset); } } ); if (typeof Drupal.textareaAttach != 'undefined') {  Drupal.textareaAttach(null, fieldset); } } else {  $(fieldset.contentWrapper) .slideUp('medium', function () { $(fieldset).addClass('collapsed'); fieldset.animating = false; } ) .show(); 
add:   var text = this.innerHTML; $(this).empty().append($('<a href="#">'+ text +'</a>').click(function() { var fieldset = $(this).parents('fieldset:first')[0];  if (!fieldset.animating) { fieldset.animating = true; Drupal.toggleFieldset(fieldset); 
context:       .click(function() {        var fieldset = this.parentNode.parentNode;        // Prevent double animations        if (fieldset.animating) {          return false;        }        fieldset.animating = true;        if ($(fieldset).is('.collapsed')) {          // Open fieldset with animation          $(fieldset.contentWrapper).hide();          $(fieldset).removeClass('collapsed');          $(fieldset.contentWrapper).slideDown(300,            {              // Make sure we open to height auto              complete: function() {                $(fieldset.contentWrapper).css('height', 'auto');                Drupal.collapseScrollIntoView(fieldset);                fieldset.animating = false;              },              // Scroll the fieldset into view              step: function() {                Drupal.collapseScrollIntoView(fieldset);              }            }          );          if (typeof Drupal.textareaAttach != 'undefined') {            // Initialize resizable textareas that are now revealed            Drupal.textareaAttach(null, fieldset);          }        }        else {          // Collapse fieldset with animation (reverse of opening)          $(fieldset.contentWrapper)            .slideUp('medium', function () { $(fieldset).addClass('collapsed'); fieldset.animating = false; } )            .show();        }        return false;      })
meta: 1288	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1288/57eecc45f6dee8d0df453937cdbd5765e4174d44/collapse.js/clean/misc/collapse.js