Make WordPress Core

Ticket #37563: 37563.4.diff

File 37563.4.diff, 2.3 KB (added by obenland, 9 years ago)
  • src/wp-admin/js/updates.js

     
    14661466                        return;
    14671467                }
    14681468
    1469                 _.each( wp.updates.queue, function( job ) {
    1470                         $document.trigger( 'credential-modal-cancel', job );
    1471                 } );
     1469                $document.trigger( 'credential-modal-cancel', wp.updates.queue[0] );
    14721470
    14731471                // Remove the lock, and clear the queue.
    14741472                wp.updates.ajaxLocked = false;
     
    17081706                                $message = $updatingMessage;
    17091707                        }
    17101708
    1711                         if ( $message ) {
     1709                        if ( $message && $message.hasClass( 'updating-message' ) ) {
    17121710                                originalText = $message.data( 'originaltext' );
    17131711
    17141712                                if ( 'undefined' === typeof originalText ) {
     
    19931991
    19941992                        // Find all the checkboxes which have been checked.
    19951993                        itemsSelected.each( function( index, element ) {
    1996                                 var $checkbox  = $( element ),
     1994                                var $checkbox = $( element ),
    19971995                                        $itemRow = $checkbox.parents( 'tr' );
    19981996
    1999                                 // Un-check the box.
    2000                                 $checkbox.prop( 'checked', false );
    2001 
    20021997                                // Only add update-able items to the update queue.
    20031998                                if ( 'update-selected' === bulkAction && ( ! $itemRow.hasClass( 'update' ) || $itemRow.find( 'notice-error' ).length ) ) {
     1999
     2000                                        // Un-check the box.
     2001                                        $checkbox.prop( 'checked', false );
    20042002                                        return;
    20052003                                }
    20062004
     
    20162014
    20172015                        // Display bulk notification for updates of any kind.
    20182016                        $document.on( 'wp-plugin-update-success wp-plugin-update-error wp-theme-update-success wp-theme-update-error', function( event, response ) {
    2019                                 var $bulkActionNotice, itemName;
     2017                                var $itemRow = $( '[data-slug="' + response.slug + '"]' ),
     2018                                        $bulkActionNotice, itemName;
    20202019
    20212020                                if ( 'wp-' + response.update + '-update-success' === event.type ) {
    20222021                                        success++;
    20232022                                } else {
    2024                                         itemName = response.pluginName ? response.pluginName : $( '[data-slug="' + response.slug + '"]' ).find( '.theme-title strong' ).text();
     2023                                        itemName = response.pluginName ? response.pluginName : $itemRow.find( '.theme-title strong' ).text();
    20252024
    20262025                                        error++;
    20272026                                        errorMessages.push( itemName + ': ' + response.errorMessage );
    20282027                                }
    20292028
     2029                                $itemRow.find( 'input[name="checked[]"]:checked' ).prop( 'checked', false );
     2030
    20302031                                wp.updates.adminNotice = wp.template( 'wp-bulk-updates-admin-notice' );
    20312032
    20322033                                wp.updates.addAdminNotice( {