Dynamically prepend screen reader text to the attachment filters dropdown and the search box in the media modal.

Props SergeyBiryukov.
Fixes #25102.


git-svn-id: https://develop.svn.wordpress.org/trunk@28839 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-06-26 01:27:37 +00:00
parent 3ace2eba1d
commit 0105f41c77

View File

@ -5373,6 +5373,7 @@
media.view.Search = media.View.extend({
tagName: 'input',
className: 'search',
id: 'media-search-input',
attributes: {
type: 'search',
@ -5414,6 +5415,7 @@
media.view.AttachmentFilters = media.View.extend({
tagName: 'select',
className: 'attachment-filters',
id: 'media-attachment-filters',
events: {
change: 'change'
@ -5639,7 +5641,7 @@
},
createToolbar: function() {
var filters, FiltersConstructor;
var filters, FiltersConstructor, screenReaderText;
/**
* @member {wp.media.view.Toolbar}
@ -5665,6 +5667,9 @@
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({
@ -5677,6 +5682,8 @@
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 ) {