Media Grid: add screen reader text in a subview on the toolbar, a `media.view.Label` instance before `media.view.DateFilter`.

See #29026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-08-07 20:25:16 +00:00
parent 3f17e7040e
commit 8593f7b5e9
3 changed files with 15 additions and 1 deletions

View File

@ -5716,15 +5716,26 @@
className: 'view-switch media-grid-view-switch',
template: media.template( 'media-library-view-switcher')
});
this.toolbar.set( 'libraryViewSwitcher', new LibraryViewSwitcher({
controller: this.controller,
priority: -90
}).render() );
// BulkSelection is a <div> with subviews, including screen reader text
this.toolbar.set( 'bulkSelection', new media.view.BulkSelection({
controller: this.controller,
priority: -70
}).render() );
// DateFilter is a <select>, screen reader text needs to be rendered before
this.toolbar.set( 'dateFilterLabel', new media.view.Label({
value: l10n.filterByDate,
attributes: {
'for': 'media-attachment-date-filters'
},
priority: -75
}).render() );
this.toolbar.set( 'dateFilter', new media.view.DateFilter({
controller: this.controller,
model: this.collection.props,
@ -6583,6 +6594,8 @@
render: function() {
this.$el.html( this.value );
return this;
}
});

File diff suppressed because one or more lines are too long

View File

@ -2940,6 +2940,7 @@ function wp_enqueue_media( $args = array() ) {
'bulkActionsLabel' => __( 'Select bulk action' ),
'deletePermanently' => __( 'Delete Permanently' ),
'apply' => __( 'Apply' ),
'filterByDate' => __( 'Filter by date' ),
// Library Details
'attachmentDetails' => __( 'Attachment Details' ),