WordPress.org

Make WordPress Core

Changeset 29415


Ignore:
Timestamp:
08/06/2014 07:12:41 PM (7 years ago)
Author:
wonderboymusic
Message:

Media Grid: display upload errors in a dismissable sidebar.

See #29037.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/css/media-views.css

    r29393 r29415  
    256256    overflow: auto;
    257257    -webkit-overflow-scrolling: touch;
     258}
     259
     260.upload-php .mode-grid .hide-sidebar .media-sidebar {
     261    top: 102px;
     262    display: none;
    258263}
    259264
     
    13841389    margin: 0;
    13851390    -webkit-box-shadow: none;
    1386     box-shadow: none; 
     1391    box-shadow: none;
    13871392}
    13881393
  • trunk/src/wp-includes/js/media-grid.js

    r29403 r29415  
    192192
    193193            // Browse our library of attachments.
    194             contentRegion.view = new media.view.AttachmentsBrowser({
     194            this.browserView = contentRegion.view = new media.view.AttachmentsBrowser({
    195195                controller: this,
    196196                collection: state.get('library'),
     
    202202                display:    state.get('displaySettings'),
    203203                dragInfo:   state.get('dragInfo'),
    204                 sidebar:    false,
     204                sidebar:    'errors',
    205205
    206206                suggestedWidth:  state.get('suggestedWidth'),
     
    211211                scrollElement: document
    212212            });
     213
     214            this.errors = wp.Uploader.errors;
     215            this.errors.on( 'add remove reset', this.sidebarVisibility, this );
     216        },
     217
     218        sidebarVisibility: function() {
     219            this.browserView.$( '.media-sidebar' ).toggle( this.errors.length );
    213220        }
    214221    });
  • trunk/src/wp-includes/js/media-views.js

    r29379 r29415  
    57035703            if ( this.options.sidebar ) {
    57045704                this.createSidebar();
    5705             } else {
     5705            }
     5706
     5707            if ( ! this.options.sidebar || 'errors' === this.options.sidebar ) {
    57065708                this.$el.addClass( 'hide-sidebar' );
    57075709            }
Note: See TracChangeset for help on using the changeset viewer.