Make WordPress Core

Changeset 33762


Ignore:
Timestamp:
08/26/2015 03:22:57 PM (9 years ago)
Author:
SergeyBiryukov
Message:

Make post meta box toggles accessible.

props joedolson.
fixes #33544.

Location:
trunk/src/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/common.css

    r33408 r33762  
    17891789.postbox .handlediv {
    17901790    float: right;
    1791     width: 27px;
    1792     height: 30px;
     1791    width: 33px;
     1792    height: 36px;
    17931793}
    17941794
  • trunk/src/wp-admin/includes/template.php

    r33734 r33762  
    10841084                    $hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : '';
    10851085                    echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n";
    1086                     if ( 'dashboard_browser_nag' != $box['id'] )
    1087                         echo '<div class="handlediv" title="' . esc_attr__('Click to toggle') . '"><br /></div>';
     1086                    if ( 'dashboard_browser_nag' != $box['id'] ) {
     1087                        echo '<button class="handlediv button-link" title="' . esc_attr__( 'Click to toggle' ) . '" aria-expanded="true">';
     1088                        echo '<span class="screen-reader-text">' . sprintf( __( 'Click to toggle %s panel' ), $box['title'] ) . '</span><br />';
     1089                        echo '</button>';
     1090                    }
    10881091                    echo "<h3 class='hndle'><span>{$box['title']}</span></h3>\n";
    10891092                    echo '<div class="inside">' . "\n";
  • trunk/src/wp-admin/js/postbox.js

    r29524 r33762  
    1212            self.init(page, args);
    1313
    14             $('.postbox .hndle, .postbox .handlediv').bind('click.postboxes', function() {
     14            $('.postbox .hndle, .postbox .handlediv').bind('click.postboxes', function( e ) {
    1515                var p = $(this).parent('.postbox'), id = p.attr('id');
    1616
     
    1818                    return;
    1919
    20                 p.toggleClass('closed');
     20                e.preventDefault();
     21
     22                p.toggleClass( 'closed' );
     23                $(this).attr( 'aria-expanded', ! p.hasClass( 'closed' ) );
    2124
    2225                if ( page != 'press-this' )
Note: See TracChangeset for help on using the changeset viewer.