-/* global ajaxurl, attachMediaBoxL10n, _wpMediaGridSettings */
+/* global ajaxurl, attachMediaBoxL10n, _wpMediaGridSettings, showNotice */
var findPosts;
( function( $ ){
$( '#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();
+ }
}
});
});