Ticket #32728: 32728.2.fixed.diff
File 32728.2.fixed.diff, 3.3 KB (added by , 16 months ago) |
---|
-
src/js/_enqueues/wp/customize/nav-menus.js
1664 1664 $reorderNav = control.container.find( '.menu-item-reorder-nav' ); 1665 1665 $reorderNav.find( '.menus-move-up, .menus-move-down, .menus-move-left, .menus-move-right' ).on( 'click', function() { 1666 1666 var moveBtn = $( this ); 1667 control.params.depth = control.getDepth(); 1668 1667 1669 moveBtn.focus(); 1668 1670 1669 1671 var isMoveUp = moveBtn.is( '.menus-move-up' ), … … 1677 1679 control.moveDown(); 1678 1680 } else if ( isMoveLeft ) { 1679 1681 control.moveLeft(); 1682 if ( 1 === control.params.depth ) { 1683 control.container.find( '.is-submenu' ).hide(); 1684 } else { 1685 control.container.find( '.is-submenu' ).show(); 1686 } 1680 1687 } else if ( isMoveRight ) { 1681 1688 control.moveRight(); 1689 control.params.depth += 1; 1690 if ( 0 === control.params.depth ) { 1691 control.container.find( '.is-submenu' ).hide(); 1692 } else { 1693 control.container.find( '.is-submenu' ).show(); 1694 } 1682 1695 } 1683 1696 1684 1697 moveBtn.focus(); // Re-focus after the container was moved. -
src/wp-includes/customize/class-wp-customize-nav-menu-item-control.php
69 69 <span class="item-title" aria-hidden="true"> 70 70 <span class="spinner"></span> 71 71 <span class="menu-item-title<# if ( ! data.title && ! data.original_title ) { #> no-title<# } #>">{{ data.title || data.original_title || wp.customize.Menus.data.l10n.untitled }}</span> 72 <# if ( 0 === data.depth ) { #> 73 <span class="is-submenu" style="display: none;"><?php _e( 'sub item' ); ?></span> 74 <# } else { #> 75 <span class="is-submenu"><?php _e( 'sub item' ); ?></span> 76 <# } #> 72 77 </span> 73 78 <span class="item-controls"> 74 79 <button type="button" class="button-link item-edit" aria-expanded="false"><span class="screen-reader-text"> 75 80 <?php 76 81 /* translators: 1: Title of a menu item, 2: Type of a menu item. */ 77 printf( __( 'Edit menu item: %1$s (%2$s)' ), '{{ data.title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.item_type_label }}' );82 printf( __( 'Edit menu item: %1$s (%2$s)' ), '{{ data.title || data.original_title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.item_type_label }}' ); 78 83 ?> 79 84 </span><span class="toggle-indicator" aria-hidden="true"></span></button> 80 85 <button type="button" class="button-link item-delete submitdelete deletion"><span class="screen-reader-text"> 81 86 <?php 82 87 /* translators: 1: Title of a menu item, 2: Type of a menu item. */ 83 printf( __( 'Remove Menu Item: %1$s (%2$s)' ), '{{ data.title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.item_type_label }}' );88 printf( __( 'Remove Menu Item: %1$s (%2$s)' ), '{{ data.title || data.original_title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.item_type_label }}' ); 84 89 ?> 85 90 </span></button> 86 91 </span>