Make WordPress Core

Changeset 9277


Ignore:
Timestamp:
10/22/2008 06:52:06 AM (18 years ago)
Author:
markjaquith
Message:

Fix Screen Options toggles accidentally broken in [9662]

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r9262 r9277  
    26602660                                $box_id = $box['id'];
    26612661                                echo '<label for="' . $box_id . '-hide">';
    2662                                 echo '<input name="' . $box_id . '-hide" type="checkbox" id="' . $box_id . '-hide" value="' . $box_id . '"' . (! in_array($box_id, $hidden) ? ' checked="checked"' : '') . ' />';
     2662                                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"' : '') . ' />';
    26632663                                echo "{$box['title']}</label>\n";
    26642664                        }
  • trunk/wp-admin/js/postbox.js

    r9268 r9277  
    55                                $($(this).parent().get(0)).toggleClass('closed');
    66                                postboxes.save_state(page);
    7                         });
     7                        } );
    88                        $('.postbox h3 a').click( function(e) {
    99                                e.stopPropagation();
     10                        } );
     11
     12                        $('.hide-postbox-tog').click( function() {
     13                                var box = jQuery(this).val();
     14                                if ( jQuery(this).attr('checked') ) {
     15                                        jQuery('#' + box).show();
     16                                        if ( $.isFunction( postboxes.onShow ) ) {
     17                                                postboxes.onShow( box );
     18                                        }
     19                                } else {
     20                                        jQuery('#' + box).hide();
     21                                }
     22                                postboxes.save_state(page);
    1023                        } );
    1124
Note: See TracChangeset for help on using the changeset viewer.