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

See #29026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-08-07 20:54:15 +00:00
parent 485229bc64
commit ccd0499d96
3 changed files with 10 additions and 3 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 ) {

File diff suppressed because one or more lines are too long

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' ),