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

See #29026.


git-svn-id: https://develop.svn.wordpress.org/trunk@29435 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-08-07 20:24:25 +00:00
parent b0d1b8b433
commit 42c1f07705
2 changed files with 14 additions and 0 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;
}
});

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' ),