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.
Built from https://develop.svn.wordpress.org/trunk@37901


git-svn-id: http://core.svn.wordpress.org/trunk@37842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2016-06-28 23:07:30 +00:00
parent ecda236ced
commit eb3a1bef13
8 changed files with 27 additions and 5 deletions

View File

@ -16,6 +16,10 @@
color: #555;
}
.customize-control-nav_menu_location .edit-menu {
margin-top: 1px;
}
.wp-customizer .menu-item-bar .menu-item-handle,
.wp-customizer .menu-item-settings,
.wp-customizer .menu-item-settings .description-thin {

File diff suppressed because one or more lines are too long

View File

@ -16,6 +16,10 @@
color: #555;
}
.customize-control-nav_menu_location .edit-menu {
margin-top: 1px;
}
.wp-customizer .menu-item-bar .menu-item-handle,
.wp-customizer .menu-item-settings,
.wp-customizer .menu-item-settings .description-thin {

File diff suppressed because one or more lines are too long

View File

@ -926,6 +926,19 @@
return parseInt( value, 10 );
};
// Edit menu button.
control.container.find( '.edit-menu' ).on( 'click', function() {
var menuId = control.setting();
api.section( 'nav_menu[' + menuId + ']' ).focus();
});
control.setting.bind( 'change', function() {
if ( 0 === control.setting() ) {
control.container.find( '.edit-menu' ).addClass( 'hidden' );
} else {
control.container.find( '.edit-menu' ).removeClass( 'hidden' );
}
});
// Add/remove menus from the available options when they are added and removed.
api.bind( 'add', function( setting ) {
var option, menuId, matches = setting.id.match( navMenuIdRegex );

File diff suppressed because one or more lines are too long

View File

@ -77,6 +77,7 @@ class WP_Customize_Nav_Menu_Location_Control extends WP_Customize_Control {
?>
</select>
</label>
<button type="button" class="button edit-menu<?php if ( ! $this->value() ) { echo ' hidden'; } ?>"><?php _e( 'Edit' ); ?></button>
<?php
}
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-alpha-37900';
$wp_version = '4.6-alpha-37901';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.