Make WordPress Core

Ticket #33049: 33049.2.diff

File 33049.2.diff, 2.8 KB (added by joedolson, 16 months ago)

Update patch to properly show/hide the overlay; rename property to tertiary instead of third for consistency

  • src/js/media/views/attachments/browser.js

     
    423423
    424424                if ( ! this.collection.length ) {
    425425                        this.toolbar.get( 'spinner' ).show();
     426                        this.toolbar.$( '.media-bg-overlay' ).show();
    426427                        this.dfd = this.collection.more().done( function() {
    427428                                if ( ! view.collection.length ) {
    428429                                        noItemsView.$el.removeClass( 'hidden' );
     
    430431                                        noItemsView.$el.addClass( 'hidden' );
    431432                                }
    432433                                view.toolbar.get( 'spinner' ).hide();
     434                                view.toolbar.$( '.media-bg-overlay' ).hide();
    433435                        } );
    434436                } else {
    435437                        noItemsView.$el.addClass( 'hidden' );
    436438                        view.toolbar.get( 'spinner' ).hide();
     439                        this.toolbar.$( '.media-bg-overlay' ).hide();
    437440                }
    438441        },
    439442
  • src/js/media/views/toolbar.js

     
    2828                // The toolbar is composed of two `PriorityList` views.
    2929                this.primary   = new wp.media.view.PriorityList();
    3030                this.secondary = new wp.media.view.PriorityList();
     31                this.tertiary  = new wp.media.view.PriorityList();
    3132                this.primary.$el.addClass('media-toolbar-primary search-form');
    3233                this.secondary.$el.addClass('media-toolbar-secondary');
     34                this.tertiary.$el.addClass('media-bg-overlay');
    3335
    34                 this.views.set([ this.secondary, this.primary ]);
     36                this.views.set([ this.secondary, this.primary, this.tertiary ]);
    3537
    3638                if ( this.options.items ) {
    3739                        this.set( this.options.items, { silent: true });
     
    122124                delete this._views[ id ];
    123125                this.primary.unset( id, options );
    124126                this.secondary.unset( id, options );
     127                this.tertiary.unset( id, options );
    125128
    126129                if ( ! options || ! options.silent ) {
    127130                        this.refresh();
  • src/wp-includes/css/media-views.css

     
    28092809                font-size: 14px;
    28102810                line-height: 2.71428571;
    28112811        }
     2812
     2813        .media-frame .wp-filter .media-toolbar-secondary {
     2814                position: unset;
     2815        }
     2816       
     2817        .media-frame .media-toolbar-secondary .spinner {
     2818                position: absolute;
     2819                top: 0;
     2820                bottom: 0;
     2821                margin: auto;
     2822                left: 0;
     2823                right: 0;
     2824                z-index: 9;
     2825        }
     2826       
     2827        .media-bg-overlay {
     2828                content: '';
     2829                background: #ffffff;
     2830                width: 100%;
     2831                height: 100%;
     2832                display: hidden;
     2833                position: absolute;
     2834                left: 0;
     2835                right: 0;
     2836                top: 0;
     2837                bottom: 0;
     2838                opacity: 0.6;
     2839        }
    28122840}
    28132841
    28142842/* Responsive on portrait and landscape */