Skip to content

Commit

Permalink
Media Grid:
Browse files Browse the repository at this point in the history
* Use a `media.view.Label` instance in the toolbar for the screen reader text for the "all" dropdown.
* Adjust the spinner's priority.

Fixes #29026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
staylor committed Aug 7, 2014
1 parent ccd0499 commit 8c96874
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
20 changes: 13 additions & 7 deletions wp-includes/js/media-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -5743,6 +5743,10 @@
}).render() );
}

this.toolbar.set( 'spinner', new media.view.Spinner({
priority: -60
}) );

filters = this.options.filters;
if ( 'uploaded' === filters ) {
FiltersConstructor = media.view.AttachmentFilters.Uploaded;
Expand All @@ -5751,20 +5755,22 @@
}

if ( FiltersConstructor ) {
// "FiltersConstructor" will return a <select>, need to render
// screen reader text before
this.toolbar.set( 'filtersLabel', new media.view.Label({
value: l10n.filterByType,
attributes: {
'for': 'media-attachment-filters'
},
priority: -80
}).render() );
this.toolbar.set( 'filters', new FiltersConstructor({
controller: this.controller,
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({
priority: -70
}) );

if ( this.options.search ) {
// Search is an input, screen reader text needs to be rendered before
this.toolbar.set( 'searchLabel', new media.view.Label({
Expand Down
Loading

0 comments on commit 8c96874

Please sign in to comment.