| 1 |
// $Id: menu-block.js,v 1.2 2008/12/01 09:56:56 johnalbin Exp $
|
| 2 |
|
| 3 |
$(document).ready( function() {
|
| 4 |
// Toggle display of "title link" if "block title" has a value.
|
| 5 |
$('#edit-title').change( function() {
|
| 6 |
if ($('#edit-title').val()) {
|
| 7 |
$('#edit-title-link-wrapper').slideUp('fast');
|
| 8 |
}
|
| 9 |
else {
|
| 10 |
$('#edit-title-link-wrapper').slideDown('fast');
|
| 11 |
}
|
| 12 |
} );
|
| 13 |
if ($('#edit-title').val()) {
|
| 14 |
$('#edit-title-link-wrapper').css('display', 'none');
|
| 15 |
}
|
| 16 |
// Split the un-wieldly "parent item" pull-down into two hierarchal pull-downs.
|
| 17 |
$('#edit-parent')
|
| 18 |
.html(Drupal.settings.menu_block.parent_options[Drupal.settings.menu_block.menus_default])
|
| 19 |
.val(Drupal.settings.menu_block.parent_default)
|
| 20 |
.before(Drupal.settings.menu_block.menus);
|
| 21 |
$('#edit-parent-menu').change( function() {
|
| 22 |
$('#edit-parent')
|
| 23 |
.html(Drupal.settings.menu_block.parent_options[$('#edit-parent-menu').val()])
|
| 24 |
.val(Drupal.settings.menu_block.parent_default);
|
| 25 |
} );
|
| 26 |
// Toggle display of "follow parent" if "follow" has been checked.
|
| 27 |
$('#edit-follow').change( function() {
|
| 28 |
if ($('#edit-follow:checked').length) {
|
| 29 |
$('#edit-follow-parent-wrapper').slideDown('fast');
|
| 30 |
}
|
| 31 |
else {
|
| 32 |
$('#edit-follow-parent-wrapper').slideUp('fast');
|
| 33 |
}
|
| 34 |
} );
|
| 35 |
if (!$('#edit-follow:checked').length) {
|
| 36 |
$('#edit-follow-parent-wrapper').css('display', 'none');
|
| 37 |
}
|
| 38 |
} );
|