Media Grid: use a media.view.Label instance in the toolbar for the screen reader text for Search.

See #29026.


git-svn-id: https://develop.svn.wordpress.org/trunk@29437 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-08-07 20:53:03 +00:00
parent 3d4ebded2f
commit 7b95dc861b
2 changed files with 9 additions and 2 deletions

View File

@ -5766,13 +5766,19 @@
}) );
if ( this.options.search ) {
// Search is an input, screen reader text needs to be rendered before
this.toolbar.set( 'searchLabel', new media.view.Label({
value: l10n.searchMediaLabel,
attributes: {
'for': 'media-search-input'
},
priority: 60
}).render() );
this.toolbar.set( 'search', new media.view.Search({
controller: this.controller,
model: this.collection.props,
priority: 60
}).render() );
screenReaderText = $( '<label class="screen-reader-text" for="media-search-input">' + l10n.search + '</label>' );
this.toolbar.get( 'search' ).$el.before( screenReaderText );
}
if ( this.options.dragInfo ) {

View File

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