mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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:
parent
6c3ce75b1c
commit
6ab2f15b0b
@ -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 ) {
|
||||
|
2
wp-includes/js/media-views.min.js
vendored
2
wp-includes/js/media-views.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user