Ticket #37563: 37563.4.diff
File 37563.4.diff, 2.3 KB (added by , 9 years ago) |
---|
-
src/wp-admin/js/updates.js
1466 1466 return; 1467 1467 } 1468 1468 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] ); 1472 1470 1473 1471 // Remove the lock, and clear the queue. 1474 1472 wp.updates.ajaxLocked = false; … … 1708 1706 $message = $updatingMessage; 1709 1707 } 1710 1708 1711 if ( $message ) {1709 if ( $message && $message.hasClass( 'updating-message' ) ) { 1712 1710 originalText = $message.data( 'originaltext' ); 1713 1711 1714 1712 if ( 'undefined' === typeof originalText ) { … … 1993 1991 1994 1992 // Find all the checkboxes which have been checked. 1995 1993 itemsSelected.each( function( index, element ) { 1996 var $checkbox 1994 var $checkbox = $( element ), 1997 1995 $itemRow = $checkbox.parents( 'tr' ); 1998 1996 1999 // Un-check the box.2000 $checkbox.prop( 'checked', false );2001 2002 1997 // Only add update-able items to the update queue. 2003 1998 if ( 'update-selected' === bulkAction && ( ! $itemRow.hasClass( 'update' ) || $itemRow.find( 'notice-error' ).length ) ) { 1999 2000 // Un-check the box. 2001 $checkbox.prop( 'checked', false ); 2004 2002 return; 2005 2003 } 2006 2004 … … 2016 2014 2017 2015 // Display bulk notification for updates of any kind. 2018 2016 $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; 2020 2019 2021 2020 if ( 'wp-' + response.update + '-update-success' === event.type ) { 2022 2021 success++; 2023 2022 } 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(); 2025 2024 2026 2025 error++; 2027 2026 errorMessages.push( itemName + ': ' + response.errorMessage ); 2028 2027 } 2029 2028 2029 $itemRow.find( 'input[name="checked[]"]:checked' ).prop( 'checked', false ); 2030 2030 2031 wp.updates.adminNotice = wp.template( 'wp-bulk-updates-admin-notice' ); 2031 2032 2032 2033 wp.updates.addAdminNotice( {