Fix Screen Options toggles accidentally broken in [9662]

git-svn-id: http://svn.automattic.com/wordpress/trunk@9277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2008-10-22 06:52:06 +00:00
parent 3942c97d46
commit 49847d77f3
2 changed files with 15 additions and 2 deletions

View File

@ -2659,7 +2659,7 @@ function meta_box_prefs($page) {
continue; continue;
$box_id = $box['id']; $box_id = $box['id'];
echo '<label for="' . $box_id . '-hide">'; echo '<label for="' . $box_id . '-hide">';
echo '<input name="' . $box_id . '-hide" type="checkbox" id="' . $box_id . '-hide" value="' . $box_id . '"' . (! in_array($box_id, $hidden) ? ' checked="checked"' : '') . ' />'; echo '<input class="hide-postbox-tog" name="' . $box_id . '-hide" type="checkbox" id="' . $box_id . '-hide" value="' . $box_id . '"' . (! in_array($box_id, $hidden) ? ' checked="checked"' : '') . ' />';
echo "{$box['title']}</label>\n"; echo "{$box['title']}</label>\n";
} }
} }

View File

@ -4,11 +4,24 @@
$('.postbox h3').click( function() { $('.postbox h3').click( function() {
$($(this).parent().get(0)).toggleClass('closed'); $($(this).parent().get(0)).toggleClass('closed');
postboxes.save_state(page); postboxes.save_state(page);
}); } );
$('.postbox h3 a').click( function(e) { $('.postbox h3 a').click( function(e) {
e.stopPropagation(); e.stopPropagation();
} ); } );
$('.hide-postbox-tog').click( function() {
var box = jQuery(this).val();
if ( jQuery(this).attr('checked') ) {
jQuery('#' + box).show();
if ( $.isFunction( postboxes.onShow ) ) {
postboxes.onShow( box );
}
} else {
jQuery('#' + box).hide();
}
postboxes.save_state(page);
} );
if ( $.browser.msie ) { if ( $.browser.msie ) {
$('#side-sortables').append( '<div id="make-it-tall"></div>' ); $('#side-sortables').append( '<div id="make-it-tall"></div>' );
} else { } else {