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:
parent
3d4ebded2f
commit
7b95dc861b
@ -5766,13 +5766,19 @@
|
|||||||
}) );
|
}) );
|
||||||
|
|
||||||
if ( this.options.search ) {
|
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({
|
this.toolbar.set( 'search', new media.view.Search({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
model: this.collection.props,
|
model: this.collection.props,
|
||||||
priority: 60
|
priority: 60
|
||||||
}).render() );
|
}).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 ) {
|
if ( this.options.dragInfo ) {
|
||||||
|
@ -2941,6 +2941,7 @@ function wp_enqueue_media( $args = array() ) {
|
|||||||
'deletePermanently' => __( 'Delete Permanently' ),
|
'deletePermanently' => __( 'Delete Permanently' ),
|
||||||
'apply' => __( 'Apply' ),
|
'apply' => __( 'Apply' ),
|
||||||
'filterByDate' => __( 'Filter by date' ),
|
'filterByDate' => __( 'Filter by date' ),
|
||||||
|
'searchMediaLabel' => __( 'Search Media' ),
|
||||||
|
|
||||||
// Library Details
|
// Library Details
|
||||||
'attachmentDetails' => __( 'Attachment Details' ),
|
'attachmentDetails' => __( 'Attachment Details' ),
|
||||||
|
Loading…
Reference in New Issue
Block a user