From 1ec0abb212da8da286c5f1ef25db85cca5c94cfb Mon Sep 17 00:00:00 2001 From: joedolson Date: Tue, 1 Oct 2024 18:44:01 +0000 Subject: [PATCH] Revert [59139] due to broad side effects in media library. The change in [59139] caused all media modal menus to disappear. Unprops joedolson. See #60666. git-svn-id: https://develop.svn.wordpress.org/trunk@59156 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/media/controllers/state.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/media/controllers/state.js b/src/js/media/controllers/state.js index 0e8f7dea152e3..bbc9b3826b2e7 100644 --- a/src/js/media/controllers/state.js +++ b/src/js/media/controllers/state.js @@ -165,15 +165,17 @@ var State = Backbone.Model.extend(/** @lends wp.media.controller.State.prototype _menu: function() { var menu = this.frame.menu, mode = this.get('menu'), - view, - actionMenuItems = this.frame.menu.get('views'), - actionMenuLength = actionMenuItems ? actionMenuItems.views.get().length : 0; + actionMenuItems, + actionMenuLength, + view; 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 || actionMenuLength < 2 ) { + if ( ! mode ) { return; }