mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Customizer: Fix element focus after menu item is deleted for keyboard accessibility.
Also restores box shadow on focus. Props valendesigns. Fixes #32740. Built from https://develop.svn.wordpress.org/trunk@33279 git-svn-id: http://core.svn.wordpress.org/trunk@33251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
080a4adfba
commit
4cb73cf347
@ -573,6 +573,11 @@
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.menu-item-bar .item-delete:focus {
|
||||
-webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
|
||||
box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
|
||||
}
|
||||
|
||||
.adding-menu-items .menu-item-bar .item-edit {
|
||||
display: none;
|
||||
}
|
||||
|
2
wp-admin/css/customize-nav-menus-rtl.min.css
vendored
2
wp-admin/css/customize-nav-menus-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@ -573,6 +573,11 @@
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.menu-item-bar .item-delete:focus {
|
||||
-webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
|
||||
box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
|
||||
}
|
||||
|
||||
.adding-menu-items .menu-item-bar .item-edit {
|
||||
display: none;
|
||||
}
|
||||
|
2
wp-admin/css/customize-nav-menus.min.css
vendored
2
wp-admin/css/customize-nav-menus.min.css
vendored
File diff suppressed because one or more lines are too long
@ -1146,21 +1146,21 @@
|
||||
|
||||
$removeBtn.on( 'click', function() {
|
||||
// Find an adjacent element to add focus to when this menu item goes away
|
||||
var $adjacentFocusTarget;
|
||||
if ( control.container.next().is( '.customize-control-nav_menu_item' ) ) {
|
||||
if ( ! $( 'body' ).hasClass( 'adding-menu-items' ) ) {
|
||||
$adjacentFocusTarget = control.container.next().find( '.item-edit:first' );
|
||||
} else {
|
||||
$adjacentFocusTarget = control.container.next().find( '.item-delete:first' );
|
||||
}
|
||||
} else if ( control.container.prev().is( '.customize-control-nav_menu_item' ) ) {
|
||||
if ( ! $( 'body' ).hasClass( 'adding-menu-items' ) ) {
|
||||
$adjacentFocusTarget = control.container.prev().find( '.item-edit:first' );
|
||||
} else {
|
||||
$adjacentFocusTarget = control.container.prev().find( '.item-delete:first' );
|
||||
}
|
||||
var addingItems = true, $adjacentFocusTarget, $next, $prev;
|
||||
|
||||
if ( ! $( 'body' ).hasClass( 'adding-menu-items' ) ) {
|
||||
addingItems = false;
|
||||
}
|
||||
|
||||
$next = control.container.nextAll( '.customize-control-nav_menu_item:visible' ).first();
|
||||
$prev = control.container.prevAll( '.customize-control-nav_menu_item:visible' ).first();
|
||||
|
||||
if ( $next.length ) {
|
||||
$adjacentFocusTarget = $next.find( false === addingItems ? '.item-edit' : '.item-delete' ).first();
|
||||
} else if ( $prev.length ) {
|
||||
$adjacentFocusTarget = $prev.find( false === addingItems ? '.item-edit' : '.item-delete' ).first();
|
||||
} else {
|
||||
$adjacentFocusTarget = control.container.next( '.customize-control-nav_menu' ).find( '.add-new-menu-item' );
|
||||
$adjacentFocusTarget = control.container.nextAll( '.customize-control-nav_menu' ).find( '.add-new-menu-item' ).first();
|
||||
}
|
||||
|
||||
control.container.slideUp( function() {
|
||||
|
4
wp-admin/js/customize-nav-menus.min.js
vendored
4
wp-admin/js/customize-nav-menus.min.js
vendored
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.3-beta2-33278';
|
||||
$wp_version = '4.3-beta2-33279';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user