Changeset 52166
- Timestamp:
- 11/15/2021 07:58:04 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/lib/nav-menu.js
r51010 r52166 312 312 prevItem = thisItem.prev(), 313 313 prevItemDepth = parseInt( prevItem.menuItemDepth(), 10 ), 314 prevItemId = prevItem.getItemData()['menu-item-db-id']; 314 prevItemId = prevItem.getItemData()['menu-item-db-id'], 315 a11ySpeech = menus[ 'moved' + dir.charAt(0).toUpperCase() + dir.slice(1) ]; 315 316 316 317 switch ( dir ) { … … 400 401 api.refreshKeyboardAccessibility(); 401 402 api.refreshAdvancedAccessibility(); 403 404 if ( a11ySpeech ) { 405 wp.a11y.speak( a11ySpeech ); 406 } 402 407 }, 403 408 … … 1225 1230 api.refreshKeyboardAccessibility(); 1226 1231 api.refreshAdvancedAccessibility(); 1232 wp.a11y.speak( menus.itemAdded ); 1227 1233 $( document ).trigger( 'menu-item-added', [ $menuMarkup ] ); 1228 1234 }, … … 1240 1246 api.refreshKeyboardAccessibility(); 1241 1247 api.refreshAdvancedAccessibility(); 1248 wp.a11y.speak( menus.itemAdded ); 1242 1249 $( document ).trigger( 'menu-item-added', [ $menuMarkup ] ); 1243 1250 }, … … 1514 1521 } 1515 1522 api.refreshAdvancedAccessibility(); 1523 wp.a11y.speak( menus.itemRemoved ); 1516 1524 }); 1517 1525 }, -
trunk/src/wp-admin/nav-menus.php
r51688 r52166 500 500 /* translators: %s: Item name. */ 501 501 'itemsDeleted' => __( 'Deleted menu item: %s.' ), 502 'itemAdded' => __( 'Menu item added' ), 503 'itemRemoved' => __( 'Menu item removed' ), 504 'movedUp' => __( 'Menu item moved up' ), 505 'movedDown' => __( 'Menu item moved down' ), 506 'movedTop' => __( 'Menu item moved to the top' ), 507 'movedLeft' => __( 'Menu item moved out of submenu' ), 508 'movedRight' => __( 'Menu item is now a sub-item' ), 502 509 ); 503 510 wp_localize_script( 'nav-menu', 'menus', $nav_menus_l10n ); -
trunk/tests/qunit/wp-admin/js/nav-menu.js
r47512 r52166 23 23 24 24 var testString = '<div>Hello World</div>'; 25 26 // Mock global menus. 27 if ( ! window.hasOwnProperty( 'menus' ) ) { 28 window.menus = { 29 'itemAdded': false, 30 'itemDeleted': false 31 }; 32 } 33 34 // Mock global wp.a11y. 35 window.wp = window.wp || {}; 36 window.wp.a11y = { 37 'speak': function() {} 38 }; 25 39 26 40 // Mock the internal function calls so the don't fail.
Note: See TracChangeset
for help on using the changeset viewer.