From 907d67572ad95e1a2df3ab3c64248527409e74d9 Mon Sep 17 00:00:00 2001
From: Andrea Fercia
Date: Mon, 10 Oct 2016 16:23:23 +0000
Subject: [PATCH] Accessibility: Improve the UI controls to move the Menu
items.
On the Menus screen, the links to move menu items behave like buttons: they
perform an action so they should be real buttons to be correctly reported to
assistive technologies. Since they're logically grouped controls, they should
also be wrapped in a `
-
-
-
+
type && $original_title !== false ) : ?>
diff --git a/src/wp-admin/js/nav-menu.js b/src/wp-admin/js/nav-menu.js
index 2410efe971..fdbc2eda22 100644
--- a/src/wp-admin/js/nav-menu.js
+++ b/src/wp-admin/js/nav-menu.js
@@ -406,14 +406,13 @@ var wpNavMenu;
} );
// Links for moving items
- menu.on( 'click', '.menus-move', function ( e ) {
+ menu.on( 'click', '.menus-move', function () {
var $this = $( this ),
dir = $this.data( 'dir' );
if ( 'undefined' !== typeof dir ) {
api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), dir );
}
- e.preventDefault();
});
},
@@ -515,8 +514,8 @@ var wpNavMenu;
*/
refreshAdvancedAccessibility : function() {
- // Hide all links by default
- $( '.menu-item-settings .field-move a' ).hide();
+ // Hide all the move buttons by default.
+ $( '.menu-item-settings .field-move .menus-move' ).hide();
// Mark all menu items as unprocessed
$( 'a.item-edit' ).data( 'needs_accessibility_refresh', true );