Media Grid: display upload errors in a dismissable sidebar.

See #29037.

Built from https://develop.svn.wordpress.org/trunk@29415


git-svn-id: http://core.svn.wordpress.org/trunk@29193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-08-06 19:13:15 +00:00
parent fd93879c86
commit a58a4da852
8 changed files with 28 additions and 9 deletions

View File

@ -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;
}

File diff suppressed because one or more lines are too long

View File

@ -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;
}

File diff suppressed because one or more lines are too long

View File

@ -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 );
}
});

File diff suppressed because one or more lines are too long

View File

@ -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' );
}

File diff suppressed because one or more lines are too long