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;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has-no-menu-item .button-controls {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
#nav-menus-frame {
|
#nav-menus-frame {
|
||||||
margin-right: 300px;
|
margin-right: 300px;
|
||||||
margin-top: 23px;
|
margin-top: 23px;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -27,6 +27,10 @@ ul.add-menu-item-tabs li {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has-no-menu-item .button-controls {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
#nav-menus-frame {
|
#nav-menus-frame {
|
||||||
margin-left: 300px;
|
margin-left: 300px;
|
||||||
margin-top: 23px;
|
margin-top: 23px;
|
||||||
|
|
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 )
|
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>
|
||||||
|
|
||||||
<span class="add-to-menu">
|
<span class="add-to-menu">
|
||||||
|
@ -769,7 +769,7 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) {
|
||||||
),
|
),
|
||||||
remove_query_arg($removed_args)
|
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>
|
||||||
|
|
||||||
<span class="add-to-menu">
|
<span class="add-to-menu">
|
||||||
|
|
|
@ -1060,6 +1060,13 @@ var wpNavMenu;
|
||||||
// select the search bar
|
// select the search bar
|
||||||
$('.quick-search', wrapper).focus();
|
$('.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();
|
e.preventDefault();
|
||||||
} else if ( target.hasClass('select-all') ) {
|
} else if ( target.hasClass('select-all') ) {
|
||||||
selectAreaMatch = /#(.*)$/.exec(e.target.href);
|
selectAreaMatch = /#(.*)$/.exec(e.target.href);
|
||||||
|
@ -1192,11 +1199,13 @@ var wpNavMenu;
|
||||||
form = document.getElementById('nav-menu-meta'),
|
form = document.getElementById('nav-menu-meta'),
|
||||||
pattern = /menu-item[(\[^]\]*/,
|
pattern = /menu-item[(\[^]\]*/,
|
||||||
$items = $('<div>').html(resp).find('li'),
|
$items = $('<div>').html(resp).find('li'),
|
||||||
|
wrapper = panel.closest( '.accordion-section-content' ),
|
||||||
$item;
|
$item;
|
||||||
|
|
||||||
if( ! $items.length ) {
|
if( ! $items.length ) {
|
||||||
$('.categorychecklist', panel).html( '<li><p>' + navMenuL10n.noResultsFound + '</p></li>' );
|
$('.categorychecklist', panel).html( '<li><p>' + navMenuL10n.noResultsFound + '</p></li>' );
|
||||||
$( '.spinner', panel ).removeClass( 'is-active' );
|
$( '.spinner', panel ).removeClass( 'is-active' );
|
||||||
|
wrapper.addClass( 'has-no-menu-item' );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1224,6 +1233,7 @@ var wpNavMenu;
|
||||||
|
|
||||||
$('.categorychecklist', panel).html( $items );
|
$('.categorychecklist', panel).html( $items );
|
||||||
$( '.spinner', panel ).removeClass( 'is-active' );
|
$( '.spinner', panel ).removeClass( 'is-active' );
|
||||||
|
wrapper.removeClass( 'has-no-menu-item' );
|
||||||
},
|
},
|
||||||
|
|
||||||
removeMenuItem : function(el) {
|
removeMenuItem : function(el) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue