Make WordPress Core

Changeset 37901


Ignore:
Timestamp:
06/28/2016 11:06:22 PM (7 years ago)
Author:
ocean90
Message:

Customize: Improve flow from menu locations to editing a menu.

Adds an Edit button beside the menu location to allow users to switch to the selected menu for further edits.

Props celloexpressions.
Fixes #36795.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/customize-nav-menus.css

    r37740 r37901  
    1515#customize-controls .control-section .accordion-section-title:hover .menu-in-location {
    1616    color: #555;
     17}
     18
     19.customize-control-nav_menu_location .edit-menu {
     20    margin-top: 1px;
    1721}
    1822
  • trunk/src/wp-admin/js/customize-nav-menus.js

    r37679 r37901  
    927927            };
    928928
     929            // Edit menu button.
     930            control.container.find( '.edit-menu' ).on( 'click', function() {
     931                var menuId = control.setting();
     932                api.section( 'nav_menu[' + menuId + ']' ).focus();
     933            });
     934            control.setting.bind( 'change', function() {
     935                if ( 0 === control.setting() ) {
     936                    control.container.find( '.edit-menu' ).addClass( 'hidden' );
     937                } else {
     938                    control.container.find( '.edit-menu' ).removeClass( 'hidden' );
     939                }
     940            });
     941
    929942            // Add/remove menus from the available options when they are added and removed.
    930943            api.bind( 'add', function( setting ) {
  • trunk/src/wp-includes/customize/class-wp-customize-nav-menu-location-control.php

    r35389 r37901  
    7878            </select>
    7979        </label>
     80        <button type="button" class="button edit-menu<?php if ( ! $this->value() ) { echo ' hidden'; } ?>"><?php _e( 'Edit' ); ?></button>
    8081        <?php
    8182    }
Note: See TracChangeset for help on using the changeset viewer.