mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Media: Prevent Media Library sidebar from showing with no actions.
Fix an issue where the actions sidebar in the media library could appear when there are no relevant actions available. Props sruthi89, nithi22, ivanzhuck, dhruvishah2203, joemcgill, ukdrahul, joedolson, shailu25. Fixes #58973. git-svn-id: https://develop.svn.wordpress.org/trunk@57688 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c2cca0dcfc
commit
a138b23bc6
@ -165,9 +165,12 @@ var State = Backbone.Model.extend(/** @lends wp.media.controller.State.prototype
|
||||
_menu: function() {
|
||||
var menu = this.frame.menu,
|
||||
mode = this.get('menu'),
|
||||
actionMenuItems = this.frame.menu.get('views'),
|
||||
actionMenuLength = actionMenuItems ? actionMenuItems.views.get().length : 0,
|
||||
view;
|
||||
|
||||
this.frame.$el.toggleClass( 'hide-menu', ! mode );
|
||||
// Show action menu only if it is active and has more than one default element.
|
||||
this.frame.$el.toggleClass( 'hide-menu', ! mode || actionMenuLength < 2 );
|
||||
if ( ! mode ) {
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user