Index: misc/teaser.js =================================================================== RCS file: /cvs/drupal/drupal/misc/teaser.js,v retrieving revision 1.10 diff -u -r1.10 teaser.js --- misc/teaser.js 13 Nov 2007 14:04:08 -0000 1.10 +++ misc/teaser.js 19 Dec 2007 22:52:17 -0000 @@ -17,6 +17,7 @@ // Move teaser textarea before body, and remove its form-item wrapper. var body = $('#'+ Drupal.settings.teaser[this.id]); var checkbox = $('#'+ Drupal.settings.teaserCheckbox[this.id]).parent(); + var checked = $(checkbox).children('input').attr('checked') ? true : false; var parent = teaser[0].parentNode; $(body).before(teaser); $(parent).remove(); @@ -30,13 +31,18 @@ if (teaser.val()) { body.val(trim(teaser.val()) +'\r\n\r\n'+ trim(body.val())); } - // Hide and disable teaser + // Empty, hide and disable teaser. + teaser[0].value = ''; $(teaser).attr('disabled', 'disabled'); $(teaser).parent().slideUp('fast'); - // Change label + // Change label. $(this).val(Drupal.t('Split summary at cursor')); - // Show separate teaser checkbox + // Hide separate teaser checkbox. $(checkbox).hide(); + // Because we don't want a hidden checkbox to affect saved data, save + // the current checked status and restore the default while hidden. + checked = $(checkbox).children('input').attr('checked') ? true : false; + $(checkbox).children('input').attr('checked', true); } // Split the teaser from the body. @@ -54,8 +60,8 @@ $(teaser).parent().slideDown('fast'); // Change label $(this).val(Drupal.t('Join summary')); - // Show separate teaser checkbox - $(checkbox).show(); + // Show separate teaser checkbox, restore checked value. + $(checkbox).show().children('input').attr('checked', checked); } // Add split/join button. @@ -75,7 +81,7 @@ else { $(teaser).hide(); $('input', button).val(Drupal.t('Split summary at cursor')).toggle(split_teaser, join_teaser); - $(checkbox).hide(); + $(checkbox).hide().children('input').attr('checked', true); } });