// $Id$ /** * On the block configuration page, disable/enable the title * field depending on the checkbox status. */ Drupal.behaviors.blockConfiguration = function (context) { $('#edit-customize:not(.blockConfiguration-processed)', context) .addClass('blockConfiguration-processed') .each(function () { // Checkbox not checked, disable title field if ($(this).is(':not(:checked)')) { $('#edit-title').attr({disabled:'disabled'}).val(Drupal.settings.blockConfigurationTitle); } }) .change(function () { if ($(this).is(':checked')) { // Enable and clear title field. $('#edit-title').removeAttr('disabled').val(''); } else { // Revert to default. $('#edit-title').attr({disabled:'disabled'}).val(Drupal.settings.blockConfigurationTitle); } }); };