[wp-trac] [WordPress Trac] #60666: Unwanted section appears as a sidebar in 'Create gallery' section

WordPress Trac noreply at wordpress.org
Sun Apr 7 11:53:52 UTC 2024


#60666: Unwanted section appears as a sidebar in 'Create gallery' section
---------------------------------------------+-------------------------
 Reporter:  ukdrahul                         |       Owner:  joedolson
     Type:  defect (bug)                     |      Status:  accepted
 Priority:  normal                           |   Milestone:  6.6
Component:  Media                            |     Version:  5.0
 Severity:  normal                           |  Resolution:
 Keywords:  changes-requested needs-testing  |     Focuses:  javascript
---------------------------------------------+-------------------------
Changes (by ruchirj):

 * keywords:   => changes-requested needs-testing


Comment:

 Hello i just change the code and it's working for all block who have no
 action menu here is below,

 before changes:

 {{{



         _menu: function() {
                 var menu = this.frame.menu,
                         mode = this.get('menu'),
                         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 ) {
                         return;
                 }

                 menu.mode( mode );

                 view = menu.get();
                 if ( view && view.select ) {
                         view.select( this.id );
                 }
         },

 and after changes :

         _menu: function() {
                 var menu = this.frame.menu,
                         mode = this.get('menu'),
                         actionMenuItems,
                         actionMenuLength,
                         view,
             actionMenuItems = this.frame.menu.get('views'),
                         actionMenuLength = actionMenuItems ?
 actionMenuItems.views.get().length : 0;

                 if ( this.frame.menu ) {
                         // 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) {
                         return;
                 }

                 menu.mode( mode );

                 view = menu.get();
                 if ( view && view.select ) {
                         view.select( this.id );
                 }
         },
 }}}
 media-view.js
 line 165 to 188.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60666#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list