Make WordPress Core

Changeset 27010


Ignore:
Timestamp:
01/22/2014 08:02:13 PM (13 years ago)
Author:
azaozz
Message:

Improve keyboard accessibility for the admin menu when in responsive mode, props SergeyBiryukov, fixes #26639 for 3.8.1.

Location:
branches/3.8/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.8/src/wp-admin/css/wp-admin.css

    r27008 r27010  
    1185211852        .auto-fold #adminmenuwrap {
    1185311853                position: absolute;
    11854                 left: 0;
     11854                width: 190px;
    1185511855                z-index: 100;
    1185611856        }
    … …  
    1185811858        .auto-fold #adminmenuback,
    1185911859        .auto-fold #adminmenuwrap {
    11860                 left: -200px;
    11861         }
    11862 
    11863         .auto-fold #adminmenuwrap,
    11864         .auto-fold #adminmenu,
    11865         .auto-fold #adminmenuback {
    11866                 width: 190px;
     11860                display: none;
    1186711861        }
    1186811862
    … …  
    1197011964        .auto-fold .wp-responsive-open #adminmenuback,
    1197111965        .auto-fold .wp-responsive-open #adminmenuwrap {
    11972                 left: 0;
     11966                display: block;
    1197311967        }
    1197411968
  • branches/3.8/src/wp-admin/js/common.js

    r26785 r27010  
    554554                        });
    555555
     556                        $( '#wp-admin-bar-menu-toggle a' ).attr( 'aria-expanded', 'false' );
     557
    556558                        // Toggle sidebar when toggle is clicked
    557559                        $( '#wp-admin-bar-menu-toggle' ).on( 'click.wp-responsive', function( event ) {
    558560                                event.preventDefault();
    559561                                $wpwrap.toggleClass( 'wp-responsive-open' );
     562                                if ( $wpwrap.hasClass( 'wp-responsive-open' ) ) {
     563                                        $(this).find('a').attr( 'aria-expanded', 'true' );
     564                                        $( '#adminmenu a:first' ).focus();
     565                                } else {
     566                                        $(this).find('a').attr( 'aria-expanded', 'false' );
     567                                }
    560568                        } );
    561569
  • branches/3.8/src/wp-includes/admin-bar.php

    r26800 r27010  
    167167                $wp_admin_bar->add_menu( array(
    168168                        'id'    => 'menu-toggle',
    169                         'title' => '<span class="ab-icon"></span>',
     169                        'title' => '<span class="ab-icon"></span><span class="screen-reader-text">' . __( 'Menu' ) . '</span>',
    170170                        'href'  => '#',
    171                         'meta'  => array(
    172                                 'title' => __( 'Menu' ),
    173                         ),
    174171                ) );
    175172        }
Note: See TracChangeset for help on using the changeset viewer.