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:
parent
3ace2eba1d
commit
0105f41c77
@ -5373,6 +5373,7 @@
|
|||||||
media.view.Search = media.View.extend({
|
media.view.Search = media.View.extend({
|
||||||
tagName: 'input',
|
tagName: 'input',
|
||||||
className: 'search',
|
className: 'search',
|
||||||
|
id: 'media-search-input',
|
||||||
|
|
||||||
attributes: {
|
attributes: {
|
||||||
type: 'search',
|
type: 'search',
|
||||||
@ -5414,6 +5415,7 @@
|
|||||||
media.view.AttachmentFilters = media.View.extend({
|
media.view.AttachmentFilters = media.View.extend({
|
||||||
tagName: 'select',
|
tagName: 'select',
|
||||||
className: 'attachment-filters',
|
className: 'attachment-filters',
|
||||||
|
id: 'media-attachment-filters',
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
change: 'change'
|
change: 'change'
|
||||||
@ -5639,7 +5641,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
createToolbar: function() {
|
createToolbar: function() {
|
||||||
var filters, FiltersConstructor;
|
var filters, FiltersConstructor, screenReaderText;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @member {wp.media.view.Toolbar}
|
* @member {wp.media.view.Toolbar}
|
||||||
@ -5665,6 +5667,9 @@
|
|||||||
model: this.collection.props,
|
model: this.collection.props,
|
||||||
priority: -80
|
priority: -80
|
||||||
}).render() );
|
}).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({
|
this.toolbar.set( 'spinner', new media.view.Spinner({
|
||||||
@ -5677,6 +5682,8 @@
|
|||||||
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 ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user