Media: Prompt when deleting multiple items from the Media Library

We prompt when deleting a single item from the Media Library, but not when deleting multiple items. This inconsistency is now rectified.

Props southp.
Fixes #28235.



git-svn-id: https://develop.svn.wordpress.org/trunk@37859 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2016-06-24 15:55:26 +00:00
parent 044064dcce
commit d4c360d186
1 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* global ajaxurl, attachMediaBoxL10n, _wpMediaGridSettings */
/* global ajaxurl, attachMediaBoxL10n, _wpMediaGridSettings, showNotice */
var findPosts;
( function( $ ){
@ -99,9 +99,15 @@ var findPosts;
$( '#find-posts-close' ).click( findPosts.close );
$( '#doaction, #doaction2' ).click( function( event ) {
$( 'select[name^="action"]' ).each( function() {
if ( $(this).val() === 'attach' ) {
var optionValue = $( this ).val();
if ( 'attach' === optionValue ) {
event.preventDefault();
findPosts.open();
} else if ( 'delete' === optionValue ) {
if ( ! showNotice.warn() ) {
event.preventDefault();
}
}
});
});