Media Grid:

* Use a `media.view.Label` instance in the toolbar for the screen reader text for the "all" dropdown.
* Adjust the spinner's priority.

Fixes #29026.


git-svn-id: https://develop.svn.wordpress.org/trunk@29438 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-08-07 21:00:45 +00:00
parent 7b95dc861b
commit dc74104c21
2 changed files with 14 additions and 7 deletions

View File

@ -5743,6 +5743,10 @@
}).render() );
}
this.toolbar.set( 'spinner', new media.view.Spinner({
priority: -60
}) );
filters = this.options.filters;
if ( 'uploaded' === filters ) {
FiltersConstructor = media.view.AttachmentFilters.Uploaded;
@ -5751,20 +5755,22 @@
}
if ( FiltersConstructor ) {
// "FiltersConstructor" will return a <select>, need to render
// screen reader text before
this.toolbar.set( 'filtersLabel', new media.view.Label({
value: l10n.filterByType,
attributes: {
'for': 'media-attachment-filters'
},
priority: -80
}).render() );
this.toolbar.set( 'filters', new FiltersConstructor({
controller: this.controller,
model: this.collection.props,
priority: -80
}).render() );
screenReaderText = $( '<label class="screen-reader-text" for="media-attachment-filters">' + l10n.select + '</label>' );
this.toolbar.get( 'filters' ).$el.before( screenReaderText );
}
this.toolbar.set( 'spinner', new media.view.Spinner({
priority: -70
}) );
if ( this.options.search ) {
// Search is an input, screen reader text needs to be rendered before
this.toolbar.set( 'searchLabel', new media.view.Label({

View File

@ -2941,6 +2941,7 @@ function wp_enqueue_media( $args = array() ) {
'deletePermanently' => __( 'Delete Permanently' ),
'apply' => __( 'Apply' ),
'filterByDate' => __( 'Filter by date' ),
'filterByType' => __( 'Filter by type' ),
'searchMediaLabel' => __( 'Search Media' ),
// Library Details