| 1 |
// $Id: collapse.js,v 0.1 2008/11/20 09:06:57 goba Exp $
|
| 2 |
|
| 3 |
/**
|
| 4 |
* @file
|
| 5 |
*
|
| 6 |
* Firefox crashes when the shockwave file of SWFUpload is loaded inside a collapsed fieldset.
|
| 7 |
* It's not yet clear what causes this, but by commenting the duration inside Drupal.toggleFiedset,
|
| 8 |
* it is temporarily solved.
|
| 9 |
*
|
| 10 |
* This file only containes a replacement for Drupal.toggleFieldset and is only loaded if the
|
| 11 |
* swfupload is loaded inside a collapsed fieldset and if the users browser is mozilla.
|
| 12 |
*/
|
| 13 |
|
| 14 |
|
| 15 |
Drupal.toggleFieldset = function(fieldset) {
|
| 16 |
if ($(fieldset).is('.collapsed')) {
|
| 17 |
// Action div containers are processed separately because of a IE bug
|
| 18 |
// that alters the default submit button behavior.
|
| 19 |
var content = $('> div:not(.action)', fieldset);
|
| 20 |
$(fieldset).removeClass('collapsed');
|
| 21 |
content.hide();
|
| 22 |
content.slideDown( {
|
| 23 |
// Here the duration is commented so Firefox won't crash on expanding fieldsets.
|
| 24 |
// duration: 'fast',
|
| 25 |
easing: 'linear',
|
| 26 |
complete: function() {
|
| 27 |
Drupal.collapseScrollIntoView(this.parentNode);
|
| 28 |
this.parentNode.animating = false;
|
| 29 |
$('div.action', fieldset).show();
|
| 30 |
},
|
| 31 |
step: function() {
|
| 32 |
// Scroll the fieldset into view
|
| 33 |
Drupal.collapseScrollIntoView(this.parentNode);
|
| 34 |
}
|
| 35 |
});
|
| 36 |
}
|
| 37 |
else {
|
| 38 |
$('div.action', fieldset).hide();
|
| 39 |
var content = $('> div:not(.action)', fieldset).slideUp('fast', function() {
|
| 40 |
$(this.parentNode).addClass('collapsed');
|
| 41 |
this.parentNode.animating = false;
|
| 42 |
});
|
| 43 |
}
|
| 44 |
};
|