Make WordPress Core

Ticket #40966: 40966.5.diff

File 40966.5.diff, 3.6 KB (added by swissspidy, 8 years ago)
  • src/wp-admin/js/updates.js

    diff --git src/wp-admin/js/updates.js src/wp-admin/js/updates.js
    index 233714f589..420d277e28 100644
     
    373373
    374374                if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
    375375                        $updateRow = $( 'tr[data-plugin="' + args.plugin + '"]' );
     376                        $updateRow.removeClass( 'update' ).addClass( 'updating' );
    376377                        $message   = $updateRow.find( '.update-message' ).removeClass( 'notice-error' ).addClass( 'updating-message notice-warning' ).find( 'p' );
    377378                        message    = wp.updates.l10n.pluginUpdatingLabel.replace( '%s', $updateRow.find( '.plugin-title strong' ).text() );
    378379                } else if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) {
     
    888889
    889890                // Add a plugin update row if it doesn't exist yet.
    890891                if ( ! $pluginUpdateRow.length ) {
    891                         $plugin.addClass( 'update' ).after(
     892                        $plugin.removeClass( 'updating' ).addClass( 'update' ).after(
    892893                                pluginUpdateRow( {
    893894                                        slug:    response.slug,
    894895                                        plugin:  response.plugin || response.slug,
     
    920921         *                     decorated with an abort() method.
    921922         */
    922923        wp.updates.updateTheme = function( args ) {
    923                 var $notice;
     924                var $updateRow, $message;
    924925
    925926                args = _.extend( {
    926927                        success: wp.updates.updateThemeSuccess,
     
    928929                }, args );
    929930
    930931                if ( 'themes-network' === pagenow ) {
    931                         $notice = $( '[data-slug="' + args.slug + '"]' ).find( '.update-message' ).removeClass( 'notice-error' ).addClass( 'updating-message notice-warning' ).find( 'p' );
    932 
     932                        $updateRow = $( '[data-slug="' + args.slug + '"]' );
     933                        $updateRow.removeClass( 'update' ).addClass( 'updating' );
     934                        $message = $updateRow.find( '.update-message' ).removeClass( 'notice-error' ).addClass( 'updating-message notice-warning' ).find( 'p' );
    933935                } else {
    934                         $notice = $( '#update-theme' ).closest( '.notice' ).removeClass( 'notice-large' );
     936                        $message = $( '#update-theme' ).closest( '.notice' ).removeClass( 'notice-large' );
    935937
    936                         $notice.find( 'h3' ).remove();
     938                        $message.find( 'h3' ).remove();
    937939
    938                         $notice = $notice.add( $( '[data-slug="' + args.slug + '"]' ).find( '.update-message' ) );
    939                         $notice = $notice.addClass( 'updating-message' ).find( 'p' );
     940                        $message = $message.add( $( '[data-slug="' + args.slug + '"]' ).find( '.update-message' ) );
     941                        $message = $message.addClass( 'updating-message' ).find( 'p' );
    940942                }
    941943
    942                 if ( $notice.html() !== wp.updates.l10n.updating ) {
    943                         $notice.data( 'originaltext', $notice.html() );
     944                if ( $message.html() !== wp.updates.l10n.updating ) {
     945                        $message.data( 'originaltext', $message.html() );
    944946                }
    945947
    946948                wp.a11y.speak( wp.updates.l10n.updatingMsg, 'polite' );
    947                 $notice.text( wp.updates.l10n.updating );
     949                $message.text( wp.updates.l10n.updating );
    948950
    949951                $document.trigger( 'wp-theme-updating', args );
    950952
     
    13091311
    13101312                if ( 'themes-network' === pagenow ) {
    13111313                        if ( ! $updateRow.length ) {
    1312                                 $themeRow.addClass( 'update' ).after(
     1314                                $themeRow.removeClass( 'updating' ).addClass( 'update' ).after(
    13131315                                        updateRow( {
    13141316                                                slug: response.slug,
    13151317                                                colspan: $( '#bulk-action-form' ).find( 'thead th:not(.hidden), thead td' ).length,
     
    20652067                                        $itemRow = $checkbox.parents( 'tr' );
    20662068
    20672069                                // Only add update-able items to the update queue.
    2068                                 if ( 'update-selected' === bulkAction && ( ! $itemRow.hasClass( 'update' ) || $itemRow.find( 'notice-error' ).length ) ) {
     2070                                if ( 'update-selected' === bulkAction && ( ! $itemRow.hasClass( 'update' ) || $itemRow.find( '.notice.notice-error' ).length ) ) {
    20692071
    20702072                                        // Un-check the box.
    20712073                                        $checkbox.prop( 'checked', false );