mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-02-27 03:02:53 +00:00
Menus: Remove bulk action checkboxes when menu is empty.
This changeset removes the bulk action checkboxes when there is no menu item to select. Follow-up to [51006], [51539]. Props oglekler, krishaweb, costdev, Boniu91, hugodevos, audrasjb. Fixes #54799. See #21603, #53654. git-svn-id: https://develop.svn.wordpress.org/trunk@54316 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5063b8d218
commit
3bf16aa800
@ -1557,4 +1557,19 @@
|
||||
});
|
||||
});
|
||||
|
||||
// Show bulk action
|
||||
$( document ).on( 'menu-item-added', function() {
|
||||
if ( ! $( '.bulk-actions' ).is( ':visible' ) ) {
|
||||
$( '.bulk-actions' ).show();
|
||||
}
|
||||
} );
|
||||
|
||||
// Hide bulk action
|
||||
$( document ).on( 'menu-removing-item', function( e, el ) {
|
||||
var menuElement = $( el ).parents( '#menu-to-edit' );
|
||||
if ( menuElement.find( 'li' ).length === 1 && $( '.bulk-actions' ).is( ':visible' ) ) {
|
||||
$( '.bulk-actions' ).hide();
|
||||
}
|
||||
} );
|
||||
|
||||
})(jQuery);
|
||||
|
||||
@ -1000,7 +1000,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||
</div>
|
||||
|
||||
<?php if ( ! $add_new_screen ) : ?>
|
||||
<div id="nav-menu-bulk-actions-top" class="bulk-actions">
|
||||
<div id="nav-menu-bulk-actions-top" class="bulk-actions" <?php echo $hide_style; ?>>
|
||||
<label class="bulk-select-button" for="bulk-select-switcher-top">
|
||||
<input type="checkbox" id="bulk-select-switcher-top" name="bulk-select-switcher-top" class="bulk-select-switcher">
|
||||
<span class="bulk-select-button-label"><?php _e( 'Bulk Select' ); ?></span>
|
||||
@ -1035,7 +1035,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||
?>
|
||||
|
||||
<?php if ( ! $add_new_screen ) : ?>
|
||||
<div id="nav-menu-bulk-actions-bottom" class="bulk-actions">
|
||||
<div id="nav-menu-bulk-actions-bottom" class="bulk-actions" <?php echo $hide_style; ?>>
|
||||
<label class="bulk-select-button" for="bulk-select-switcher-bottom">
|
||||
<input type="checkbox" id="bulk-select-switcher-bottom" name="bulk-select-switcher-top" class="bulk-select-switcher">
|
||||
<span class="bulk-select-button-label"><?php _e( 'Bulk Select' ); ?></span>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user