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

Props SergeyBiryukov.
Fixes #25102.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-06-26 01:28:16 +00:00
parent 6c3ce75b1c
commit 6ab2f15b0b
2 changed files with 9 additions and 2 deletions

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 ) {

File diff suppressed because one or more lines are too long