Media Grid: display upload errors in a dismissable sidebar.
See #29037. git-svn-id: https://develop.svn.wordpress.org/trunk@29415 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
77e8616615
commit
ccaf134b33
|
@ -257,6 +257,11 @@
|
|||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.upload-php .mode-grid .hide-sidebar .media-sidebar {
|
||||
top: 102px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.hide-toolbar .media-sidebar {
|
||||
bottom: 0;
|
||||
}
|
||||
|
@ -1383,7 +1388,7 @@
|
|||
padding: 0;
|
||||
margin: 0;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.media-selection .attachment .thumbnail {
|
||||
|
|
|
@ -191,7 +191,7 @@
|
|||
var state = this.state();
|
||||
|
||||
// Browse our library of attachments.
|
||||
contentRegion.view = new media.view.AttachmentsBrowser({
|
||||
this.browserView = contentRegion.view = new media.view.AttachmentsBrowser({
|
||||
controller: this,
|
||||
collection: state.get('library'),
|
||||
selection: state.get('selection'),
|
||||
|
@ -201,7 +201,7 @@
|
|||
filters: state.get('filterable'),
|
||||
display: state.get('displaySettings'),
|
||||
dragInfo: state.get('dragInfo'),
|
||||
sidebar: false,
|
||||
sidebar: 'errors',
|
||||
|
||||
suggestedWidth: state.get('suggestedWidth'),
|
||||
suggestedHeight: state.get('suggestedHeight'),
|
||||
|
@ -210,6 +210,13 @@
|
|||
|
||||
scrollElement: document
|
||||
});
|
||||
|
||||
this.errors = wp.Uploader.errors;
|
||||
this.errors.on( 'add remove reset', this.sidebarVisibility, this );
|
||||
},
|
||||
|
||||
sidebarVisibility: function() {
|
||||
this.browserView.$( '.media-sidebar' ).toggle( this.errors.length );
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -5702,7 +5702,9 @@
|
|||
this.updateContent();
|
||||
if ( this.options.sidebar ) {
|
||||
this.createSidebar();
|
||||
} else {
|
||||
}
|
||||
|
||||
if ( ! this.options.sidebar || 'errors' === this.options.sidebar ) {
|
||||
this.$el.addClass( 'hide-sidebar' );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue