mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Menus: Hide controls in the search tab if no items are found.
Props sayedwp, afercia, tywayne, abrightclearweb. Fixes #35576. Built from https://develop.svn.wordpress.org/trunk@38754 git-svn-id: http://core.svn.wordpress.org/trunk@38697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
859498efd3
commit
5fd943f49c
@ -27,6 +27,10 @@ ul.add-menu-item-tabs li {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.has-no-menu-item .button-controls {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#nav-menus-frame {
|
||||
margin-right: 300px;
|
||||
margin-top: 23px;
|
||||
|
2
wp-admin/css/nav-menus-rtl.min.css
vendored
2
wp-admin/css/nav-menus-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@ -27,6 +27,10 @@ ul.add-menu-item-tabs li {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.has-no-menu-item .button-controls {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#nav-menus-frame {
|
||||
margin-left: 300px;
|
||||
margin-top: 23px;
|
||||
|
2
wp-admin/css/nav-menus.min.css
vendored
2
wp-admin/css/nav-menus.min.css
vendored
File diff suppressed because one or more lines are too long
@ -571,7 +571,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $box ) {
|
||||
),
|
||||
remove_query_arg( $removed_args )
|
||||
));
|
||||
?>#posttype-<?php echo $post_type_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
|
||||
?>#posttype-<?php echo $post_type_name; ?>" class="select-all aria-button-if-js"><?php _e( 'Select All' ); ?></a>
|
||||
</span>
|
||||
|
||||
<span class="add-to-menu">
|
||||
@ -769,7 +769,7 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) {
|
||||
),
|
||||
remove_query_arg($removed_args)
|
||||
));
|
||||
?>#taxonomy-<?php echo $taxonomy_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
|
||||
?>#taxonomy-<?php echo $taxonomy_name; ?>" class="select-all aria-button-if-js"><?php _e( 'Select All' ); ?></a>
|
||||
</span>
|
||||
|
||||
<span class="add-to-menu">
|
||||
|
@ -1060,6 +1060,13 @@ var wpNavMenu;
|
||||
// select the search bar
|
||||
$('.quick-search', wrapper).focus();
|
||||
|
||||
// Hide controls in the search tab if no items found.
|
||||
if ( ! wrapper.find( '.tabs-panel-active .menu-item-title' ).length ) {
|
||||
wrapper.addClass( 'has-no-menu-item' );
|
||||
} else {
|
||||
wrapper.removeClass( 'has-no-menu-item' );
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
} else if ( target.hasClass('select-all') ) {
|
||||
selectAreaMatch = /#(.*)$/.exec(e.target.href);
|
||||
@ -1192,11 +1199,13 @@ var wpNavMenu;
|
||||
form = document.getElementById('nav-menu-meta'),
|
||||
pattern = /menu-item[(\[^]\]*/,
|
||||
$items = $('<div>').html(resp).find('li'),
|
||||
wrapper = panel.closest( '.accordion-section-content' ),
|
||||
$item;
|
||||
|
||||
if( ! $items.length ) {
|
||||
$('.categorychecklist', panel).html( '<li><p>' + navMenuL10n.noResultsFound + '</p></li>' );
|
||||
$( '.spinner', panel ).removeClass( 'is-active' );
|
||||
wrapper.addClass( 'has-no-menu-item' );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1224,6 +1233,7 @@ var wpNavMenu;
|
||||
|
||||
$('.categorychecklist', panel).html( $items );
|
||||
$( '.spinner', panel ).removeClass( 'is-active' );
|
||||
wrapper.removeClass( 'has-no-menu-item' );
|
||||
},
|
||||
|
||||
removeMenuItem : function(el) {
|
||||
|
2
wp-admin/js/nav-menu.min.js
vendored
2
wp-admin/js/nav-menu.min.js
vendored
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.7-alpha-38753';
|
||||
$wp_version = '4.7-alpha-38754';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user