mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Media: Fix broken media modal following [57688]
Fix undefined TypeError overlooked in [57688]. Props antpb, swissspidy, joedolson. Fixes #58973. git-svn-id: https://develop.svn.wordpress.org/trunk@57691 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
84ce628d0b
commit
bf2d4016aa
@ -165,12 +165,16 @@ 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,
|
||||
actionMenuItems,
|
||||
actionMenuLength,
|
||||
view;
|
||||
|
||||
// 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 ( this.frame.menu ) {
|
||||
actionMenuItems = this.frame.menu.get('views'),
|
||||
actionMenuLength = actionMenuItems ? actionMenuItems.views.get().length : 0,
|
||||
// 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