From 49847d77f3dda2c593bbee1bf70c98324397af57 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Wed, 22 Oct 2008 06:52:06 +0000 Subject: [PATCH] Fix Screen Options toggles accidentally broken in [9662] git-svn-id: http://svn.automattic.com/wordpress/trunk@9277 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 2 +- wp-admin/js/postbox.js | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 57e330ecf4..1b0269d854 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -2659,7 +2659,7 @@ function meta_box_prefs($page) { continue; $box_id = $box['id']; echo '\n"; } } diff --git a/wp-admin/js/postbox.js b/wp-admin/js/postbox.js index 9814446fee..9a76896d1b 100644 --- a/wp-admin/js/postbox.js +++ b/wp-admin/js/postbox.js @@ -4,11 +4,24 @@ $('.postbox h3').click( function() { $($(this).parent().get(0)).toggleClass('closed'); postboxes.save_state(page); - }); + } ); $('.postbox h3 a').click( function(e) { 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 ) { $('#side-sortables').append( '
' ); } else {