Media Modal: Restore uploader view, when no items are found.

see #28963.
Built from https://develop.svn.wordpress.org/trunk@29364


git-svn-id: http://core.svn.wordpress.org/trunk@29140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2014-08-02 20:47:16 +00:00
parent 91764118fb
commit e6513fe33b
7 changed files with 22 additions and 22 deletions

View File

@ -1013,14 +1013,10 @@
outline: none; outline: none;
} }
.attachments-browser .uploader-inline { .media-frame.mode-grid .uploader-inline {
border: 4px dashed #bbb; border: 4px dashed #bbb;
} }
.attachments-browser .uploader-inline:not(.hidden) + .attachments {
top: 350px;
}
.attachments-browser .uploader-inline.hidden { .attachments-browser .uploader-inline.hidden {
display: none; display: none;
} }

File diff suppressed because one or more lines are too long

View File

@ -1013,14 +1013,10 @@
outline: none; outline: none;
} }
.attachments-browser .uploader-inline { .media-frame.mode-grid .uploader-inline {
border: 4px dashed #bbb; border: 4px dashed #bbb;
} }
.attachments-browser .uploader-inline:not(.hidden) + .attachments {
top: 350px;
}
.attachments-browser .uploader-inline.hidden { .attachments-browser .uploader-inline.hidden {
display: none; display: none;
} }

File diff suppressed because one or more lines are too long

View File

@ -3695,12 +3695,14 @@
suggestedHeight = this.controller.state().get('suggestedHeight'), suggestedHeight = this.controller.state().get('suggestedHeight'),
data = {}; data = {};
data.message = this.options.message;
data.canClose = this.options.canClose; data.canClose = this.options.canClose;
if ( suggestedWidth && suggestedHeight ) { if ( suggestedWidth && suggestedHeight ) {
data.suggestedWidth = suggestedWidth; data.suggestedWidth = suggestedWidth;
data.suggestedHeight = suggestedHeight; data.suggestedHeight = suggestedHeight;
} }
return data; return data;
}, },
/** /**
@ -5840,19 +5842,27 @@
}, },
updateContent: function() { updateContent: function() {
var view = this; var view = this,
noItemsView;
if ( this.controller.isModeActive( 'grid' ) ) {
noItemsView = view.attachmentsNoResults;
} else {
noItemsView = view.uploader;
}
if ( ! this.collection.length ) { if ( ! this.collection.length ) {
this.toolbar.get( 'spinner' ).show(); this.toolbar.get( 'spinner' ).show();
this.collection.more().done(function() { this.collection.more().done(function() {
if ( ! view.collection.length ) { if ( ! view.collection.length ) {
view.attachmentsNoResults.$el.removeClass( 'hidden' ); noItemsView.$el.removeClass( 'hidden' );
} else { } else {
view.attachmentsNoResults.$el.addClass( 'hidden' ); noItemsView.$el.addClass( 'hidden' );
} }
view.toolbar.get( 'spinner' ).hide(); view.toolbar.get( 'spinner' ).hide();
}); });
} else { } else {
this.attachmentsNoResults.$el.addClass( 'hidden' ); noItemsView.$el.addClass( 'hidden' );
view.toolbar.get( 'spinner' ).hide(); view.toolbar.get( 'spinner' ).hide();
} }
}, },
@ -5865,7 +5875,7 @@
canClose: this.controller.isModeActive( 'grid' ) canClose: this.controller.isModeActive( 'grid' )
}); });
this.uploader.$el.addClass( 'hidden' ); this.uploader.hide();
this.views.add( this.uploader ); this.views.add( this.uploader );
}, },
@ -5901,8 +5911,6 @@
this.attachmentsNoResults.$el.html( l10n.noMedia ); this.attachmentsNoResults.$el.html( l10n.noMedia );
this.views.add( this.attachmentsNoResults ); this.views.add( this.attachmentsNoResults );
}, },
createSidebar: function() { createSidebar: function() {

File diff suppressed because one or more lines are too long

View File

@ -161,7 +161,7 @@ function wp_print_media_templates() {
<script type="text/html" id="tmpl-uploader-inline"> <script type="text/html" id="tmpl-uploader-inline">
<# var messageClass = data.message ? 'has-upload-message' : 'no-upload-message'; #> <# var messageClass = data.message ? 'has-upload-message' : 'no-upload-message'; #>
<# if ( data.canClose ) { #> <# if ( data.canClose ) { #>
<button class="close dashicons dashicons-no"><span class="screen-reader-text">Close overlay</span></button> <button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close uploader' ); ?></span></button>
<# } #> <# } #>
<div class="uploader-inline-content {{ messageClass }}"> <div class="uploader-inline-content {{ messageClass }}">
<# if ( data.message ) { #> <# if ( data.message ) { #>