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:
parent
b0d1b8b433
commit
42c1f07705
@ -5716,15 +5716,26 @@
|
|||||||
className: 'view-switch media-grid-view-switch',
|
className: 'view-switch media-grid-view-switch',
|
||||||
template: media.template( 'media-library-view-switcher')
|
template: media.template( 'media-library-view-switcher')
|
||||||
});
|
});
|
||||||
|
|
||||||
this.toolbar.set( 'libraryViewSwitcher', new LibraryViewSwitcher({
|
this.toolbar.set( 'libraryViewSwitcher', new LibraryViewSwitcher({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
priority: -90
|
priority: -90
|
||||||
}).render() );
|
}).render() );
|
||||||
|
|
||||||
|
// BulkSelection is a <div> with subviews, including screen reader text
|
||||||
this.toolbar.set( 'bulkSelection', new media.view.BulkSelection({
|
this.toolbar.set( 'bulkSelection', new media.view.BulkSelection({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
priority: -70
|
priority: -70
|
||||||
}).render() );
|
}).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({
|
this.toolbar.set( 'dateFilter', new media.view.DateFilter({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
model: this.collection.props,
|
model: this.collection.props,
|
||||||
@ -6583,6 +6594,8 @@
|
|||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
this.$el.html( this.value );
|
this.$el.html( this.value );
|
||||||
|
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2940,6 +2940,7 @@ function wp_enqueue_media( $args = array() ) {
|
|||||||
'bulkActionsLabel' => __( 'Select bulk action' ),
|
'bulkActionsLabel' => __( 'Select bulk action' ),
|
||||||
'deletePermanently' => __( 'Delete Permanently' ),
|
'deletePermanently' => __( 'Delete Permanently' ),
|
||||||
'apply' => __( 'Apply' ),
|
'apply' => __( 'Apply' ),
|
||||||
|
'filterByDate' => __( 'Filter by date' ),
|
||||||
|
|
||||||
// Library Details
|
// Library Details
|
||||||
'attachmentDetails' => __( 'Attachment Details' ),
|
'attachmentDetails' => __( 'Attachment Details' ),
|
||||||
|
Loading…
Reference in New Issue
Block a user