When viewing media in List mode, auto-submit the form for attachment filters when the value of a `<select>` changes. This makes it behave similar to Grid mode and "feels" more performant, even though it is a full page load.

Fixes #30333.


git-svn-id: https://develop.svn.wordpress.org/trunk@31582 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-02-27 21:26:42 +00:00
parent 22179be8ca
commit a46c2462da
1 changed files with 7 additions and 1 deletions

View File

@ -72,7 +72,13 @@ var findPosts;
};
$( document ).ready( function() {
var settings, $mediaGridWrap = $( '#wp-media-grid' );
var settings,
$mediaGridWrap = $( '#wp-media-grid' ),
$form = $( '#posts-filter' );
$form.find( 'select' ).on( 'change', function () {
$form.submit();
} );
// Open up a manage media frame into the grid.
if ( $mediaGridWrap.length && window.wp && window.wp.media ) {