| 51 |
case 0: |
case 0: |
| 52 |
showOrHide == 'show' ? toSwitch.show() : toSwitch.hide(); |
showOrHide == 'show' ? toSwitch.show() : toSwitch.hide(); |
| 53 |
case 1: |
case 1: |
| 54 |
showOrHide == 'show' ? toSwitch.slideDown(Drupal.settings.ConditionalFields.ui_settings.anim_speed) : |
/* Don't double top and bottom margins while sliding. */ |
| 55 |
toSwitch.slideUp(Drupal.settings.ConditionalFields.ui_settings.anim_speed); |
var firstChild = toSwitch.children(':first-child'); |
| 56 |
|
var marginTop = firstChild.css('margin-top'); |
| 57 |
|
var marginBottom = firstChild.css('margin-bottom'); |
| 58 |
|
firstChild.css('margin-top', '0').css('margin-bottom', '0'); |
| 59 |
|
if (showOrHide == 'show') { |
| 60 |
|
toSwitch.slideDown(Drupal.settings.ConditionalFields.ui_settings.anim_speed, function() { |
| 61 |
|
firstChild.css('margin-top', marginTop).css('margin-bottom', marginBottom); |
| 62 |
|
}); |
| 63 |
|
} |
| 64 |
|
else { |
| 65 |
|
toSwitch.slideUp(Drupal.settings.ConditionalFields.ui_settings.anim_speed, function() { |
| 66 |
|
firstChild.css('margin-top', marginTop).css('margin-bottom', marginBottom); |
| 67 |
|
}); |
| 68 |
|
} |
| 69 |
case 2: |
case 2: |
| 70 |
showOrHide == 'show' ? toSwitch.fadeIn(Drupal.settings.ConditionalFields.ui_settings.anim_speed) : |
showOrHide == 'show' ? toSwitch.fadeIn(Drupal.settings.ConditionalFields.ui_settings.anim_speed) : |
| 71 |
toSwitch.fadeOut(Drupal.settings.ConditionalFields.ui_settings.anim_speed); |
toSwitch.fadeOut(Drupal.settings.ConditionalFields.ui_settings.anim_speed); |