mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-09 03:30:06 +00:00
Customizer: Improve descriptive text and focus for menu items reorder button.
props afercia. fixes #32725. git-svn-id: https://develop.svn.wordpress.org/trunk@33074 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -91,7 +91,14 @@
|
||||
}
|
||||
|
||||
/* Menu-item reordering nav. */
|
||||
#customize-theme-controls button.reorder-toggle {
|
||||
#customize-theme-controls .reordering .reorder,
|
||||
#customize-theme-controls .reorder-done {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#customize-theme-controls .reorder,
|
||||
#customize-theme-controls .reordering .reorder-done {
|
||||
display: inline-block;
|
||||
padding: 5px 8px;
|
||||
}
|
||||
|
||||
|
||||
@@ -1932,6 +1932,9 @@
|
||||
* @param {Boolean} showOrHide to enable/disable reordering
|
||||
*/
|
||||
toggleReordering: function( showOrHide ) {
|
||||
var addNewItemBtn = this.container.find( '.add-new-menu-item' ),
|
||||
reorderBtn = this.container.find( '.reorder-toggle' );
|
||||
|
||||
showOrHide = Boolean( showOrHide );
|
||||
|
||||
if ( showOrHide === this.$sectionContent.hasClass( 'reordering' ) ) {
|
||||
@@ -1941,6 +1944,15 @@
|
||||
this.isReordering = showOrHide;
|
||||
this.$sectionContent.toggleClass( 'reordering', showOrHide );
|
||||
this.$sectionContent.sortable( this.isReordering ? 'disable' : 'enable' );
|
||||
if ( this.isReordering ) {
|
||||
addNewItemBtn.attr( 'tabindex', '-1' );
|
||||
reorderBtn.find( '.reorder-done' ).focus();
|
||||
wp.a11y.speak( api.Menus.data.l10n.reorderModeOn );
|
||||
} else {
|
||||
addNewItemBtn.removeAttr( 'tabindex' );
|
||||
reorderBtn.find( '.reorder' ).focus();
|
||||
wp.a11y.speak( api.Menus.data.l10n.reorderModeOff );
|
||||
}
|
||||
|
||||
if ( showOrHide ) {
|
||||
_( this.getMenuItemControls() ).each( function( formControl ) {
|
||||
|
||||
Reference in New Issue
Block a user