Customizer - Widgets: add feedback for screen readers when moving up or down. Props adamsilverstein, afercia. Fixes #28892.

git-svn-id: https://develop.svn.wordpress.org/trunk@30760 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2014-12-07 00:44:49 +00:00
parent ae45b7462b
commit af5c93a432
3 changed files with 5 additions and 0 deletions

View File

@ -118,6 +118,7 @@ do_action( 'customize_controls_print_scripts' );
<body class="<?php echo esc_attr( $body_class ); ?>">
<div class="wp-full-overlay expanded">
<form id="customize-controls" class="wrap wp-full-overlay-sidebar">
<div id="screen-reader-messages" aria-live="polite" aria-relevant="all" aria-role="status" aria-atomic="true" class="screen-reader-text"></div>
<div id="customize-header-actions" class="wp-full-overlay-header">
<?php

View File

@ -671,8 +671,10 @@
if ( isMoveUp ) {
self.moveUp();
$( '#screen-reader-messages' ).text( l10n.widgetMovedUp );
} else {
self.moveDown();
$( '#screen-reader-messages' ).text( l10n.widgetMovedDown );
}
$( this ).focus(); // re-focus after the container was moved

View File

@ -728,6 +728,8 @@ final class WP_Customize_Widgets {
'removeBtnLabel' => __( 'Remove' ),
'removeBtnTooltip' => __( 'Trash widget by moving it to the inactive widgets sidebar.' ),
'error' => __( 'An error has occurred. Please reload the page and try again.' ),
'widgetMovedUp' => __( 'Widget moved up' ),
'widgetMovedDown' => __( 'Widget moved down' ),
),
'tpl' => array(
'widgetReorderNav' => $widget_reorder_nav_tpl,