Hi!
I have been trying to change the speed of the collapsiblock and also the type, I have done it and it worked, so I thought, why not try to implement this in the collapsiblock settings. However, my coding abilitys are not the best so I cannot get it to work.
This is what I have changed in the collapsiblock.module (this one needs to be sent to the js in some way i don't know)
$form['collapsiblock']['speed'] = array(
'#type' => 'radios',
'#title' => t('Block collapse speed'),
'#options' => array(1 => t('1'), 2 => t('200'), 3 => t('2000.'));
'#default_value' => $settings['block-' . $form['module']['#value'] . '-' . $form['delta']['#value']] ? $settings['block-' . $form['module']['#value'] . '-' . $form['delta']['#value']] : 2
);
$form['collapsiblock']['type'] = array(
'#type' => 'radios',
'#title' => t('Block collapse type'),
'#options' => array(1 => t('Hide'), 2 => t('SlideUp'));
'#default_value' => $settings['block-' . $form['module']['#value'] . '-' . $form['delta']['#value']] ? $settings['block-' . $form['module']['#value'] . '-' . $form['delta']['#value']] : 2
);
and in the collapsiblock.js
if (titleElt) {
// Status values: 1 = not collapsible, 2 = collapsible and expanded, 3 = collapsible and collapsed
var status = Drupal.settings.collapsiblock[this.id] ? Drupal.settings.collapsiblock[this.id] : 2;
if (status == 1) {
return;
}
titleElt.target = $(this).find('div.content');
$(titleElt)
.addClass('collapsiblock')
.click(function () {
var st = $.cookie('collapsiblock-' + id);
$.cookie('collapsiblock-' + id, st == 0 ? 1 : 0);
$(this).toggleClass('collapsiblockCollapsed');
//SOME KIND OF IF IS NEEDED
$(this.target).toggle(1); //SPEED
});
if (status == 3 || $.cookie('collapsiblock-' + id) == 1) {
$(titleElt).addClass('collapsiblockCollapsed');
//SOMEKIND OF IF IS NEEDED
$(titleElt.target).hide(); //TYPE
}
else {
$.cookie('collapsiblock-' + id, 0);
}
}
});