Make WordPress Core

Ticket #32728: 32728.2.fixed.diff

File 32728.2.fixed.diff, 3.3 KB (added by rcreators, 16 months ago)

The patch is missing slash before src directory. so was not able to apply. I updated it and its working now. any one can test it. Patch works fine.

  • src/js/_enqueues/wp/customize/nav-menus.js

     
    16641664                        $reorderNav = control.container.find( '.menu-item-reorder-nav' );
    16651665                        $reorderNav.find( '.menus-move-up, .menus-move-down, .menus-move-left, .menus-move-right' ).on( 'click', function() {
    16661666                                var moveBtn = $( this );
     1667                                control.params.depth = control.getDepth();
     1668
    16671669                                moveBtn.focus();
    16681670
    16691671                                var isMoveUp = moveBtn.is( '.menus-move-up' ),
     
    16771679                                        control.moveDown();
    16781680                                } else if ( isMoveLeft ) {
    16791681                                        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                                        }
    16801687                                } else if ( isMoveRight ) {
    16811688                                        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                                        }
    16821695                                }
    16831696
    16841697                                moveBtn.focus(); // Re-focus after the container was moved.
  • src/wp-includes/customize/class-wp-customize-nav-menu-item-control.php

     
    6969                                <span class="item-title" aria-hidden="true">
    7070                                        <span class="spinner"></span>
    7171                                        <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                                        <# } #>
    7277                                </span>
    7378                                <span class="item-controls">
    7479                                        <button type="button" class="button-link item-edit" aria-expanded="false"><span class="screen-reader-text">
    7580                                        <?php
    7681                                                /* 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 }}' );
    7883                                        ?>
    7984                                        </span><span class="toggle-indicator" aria-hidden="true"></span></button>
    8085                                        <button type="button" class="button-link item-delete submitdelete deletion"><span class="screen-reader-text">
    8186                                        <?php
    8287                                                /* 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 }}' );
    8489                                        ?>
    8590                                        </span></button>
    8691                                </span>