Make WordPress Core

Changeset 57691


Ignore:
Timestamp:
02/21/2024 08:55:50 PM (10 months ago)
Author:
joedolson
Message:

Media: Fix broken media modal following [57688]

Fix undefined TypeError overlooked in [57688].

Props antpb, swissspidy, joedolson.
Fixes #58973.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/media/controllers/state.js

    r57688 r57691  
    166166        var menu = this.frame.menu,
    167167            mode = this.get('menu'),
     168            actionMenuItems,
     169            actionMenuLength,
     170            view;
     171
     172        if ( this.frame.menu ) {
    168173            actionMenuItems = this.frame.menu.get('views'),
    169174            actionMenuLength = actionMenuItems ? actionMenuItems.views.get().length : 0,
    170             view;
    171 
    172         // Show action menu only if it is active and has more than one default element.
    173         this.frame.$el.toggleClass( 'hide-menu', ! mode || actionMenuLength < 2 );
     175            // Show action menu only if it is active and has more than one default element.
     176            this.frame.$el.toggleClass( 'hide-menu', ! mode || actionMenuLength < 2 );
     177        }
    174178        if ( ! mode ) {
    175179            return;
Note: See TracChangeset for help on using the changeset viewer.