Make WordPress Core

Ticket #28235: prompt-on-bulk-delete-in-list-mode.diff

File prompt-on-bulk-delete-in-list-mode.diff, 718 bytes (added by southp, 10 years ago)
  • wp-admin/js/media.js

     
    9999                $( '#find-posts-close' ).click( findPosts.close );
    100100                $( '#doaction, #doaction2' ).click( function( event ) {
    101101                        $( 'select[name^="action"]' ).each( function() {
    102                                 if ( $(this).val() === 'attach' ) {
     102                                var optionValue = $( this ).val();
     103
     104                                switch( optionValue ) {
     105                                case 'attach':
    103106                                        event.preventDefault();
    104107                                        findPosts.open();
     108                                        break;
     109                                case 'delete':
     110                                        if ( ! showNotice.warn() ) {
     111                                                event.preventDefault();
     112                                        }
     113                                        break;
     114                                default:
     115                                        break;
    105116                                }
    106117                        });
    107118                });