Make WordPress Core

Ticket #42365: 42365.4.diff

File 42365.4.diff, 3.6 KB (added by obenland, 8 years ago)
  • src/wp-admin/css/customize-controls.css

     
    20302030        display: none;
    20312031}
    20322032
    2033 .themes-section-installed_themes .theme .notice-success {
     2033.themes-section-installed_themes .theme .notice-success:not(.updated-message) {
    20342034        display: none; /* Hide "installed" notice on installed themes tab. */
    20352035}
    20362036
  • src/wp-admin/js/customize-controls.js

     
    33473347                                api.control.each( function( control ) {
    33483348                                        if ( 'theme' === control.params.type && control.params.theme.id === response.slug ) {
    33493349                                                control.params.theme.hasUpdate = false;
    3350                                                 control.rerenderAsInstalled( true );
     3350                                                control.params.theme.version = response.newVersion;
     3351                                                setTimeout( function() { control.rerenderAsInstalled( true ); }, 2000 );
    33513352                                        }
    33523353                                });
    33533354                        } );
  • src/wp-admin/js/updates.js

     
    937937                } else if ( 'customize' === pagenow ) {
    938938
    939939                        // Update the theme details UI.
    940                         $notice = $( '#update-theme' ).closest( '.notice' ).removeClass( 'notice-large' );
     940                        $notice = $( '[data-slug="' + args.slug + '"].notice' ).removeClass( 'notice-large' );
    941941
    942942                        $notice.find( 'h3' ).remove();
    943943
     
    988988                        $notice, newText;
    989989
    990990                if ( 'customize' === pagenow ) {
    991                         $theme = wp.customize.control( 'installed_theme_' + response.slug ).container;
    992                 }
     991                        $theme = $( '.updating-message' ).siblings( '.theme-name' );
    993992
    994                 if ( 'themes-network' === pagenow ) {
     993                        if ( $theme.length ) {
     994
     995                                // Update the version number in the row.
     996                                newText = $theme.html().replace( response.oldVersion, response.newVersion );
     997                                $theme.html( newText );
     998                        }
     999
     1000                        $notice = $( '.theme-info .notice' ).add( wp.customize.control( 'installed_theme_' + response.slug ).container.find( '.theme' ).find( '.update-message' ) );
     1001                } else if ( 'themes-network' === pagenow ) {
    9951002                        $notice = $theme.find( '.update-message' );
    9961003
    9971004                        // Update the version number in the row.
     
    10161023                $document.trigger( 'wp-theme-update-success', response );
    10171024
    10181025                // Show updated message after modal re-rendered.
    1019                 if ( isModalOpen ) {
     1026                if ( isModalOpen && 'customize' !== pagenow ) {
    10201027                        $( '.theme-info .theme-author' ).after( wp.updates.adminNotice( updatedMessage ) );
    10211028                }
    10221029        };
     
    10461053                }
    10471054
    10481055                if ( 'customize' === pagenow ) {
    1049                         $theme = wp.customize.control( 'installed_theme_' + response.slug ).container;
     1056                        $theme = wp.customize.control( 'installed_theme_' + response.slug ).container.find( '.theme' );
    10501057                }
    10511058
    10521059                if ( 'themes-network' === pagenow ) {
  • src/wp-includes/customize/class-wp-customize-themes-section.php

     
    6969         * @since 4.9.0
    7070         */
    7171        protected function render_template() {
     72                wp_localize_script( 'updates', '_wpUpdatesItemCounts', array(
     73                        'totals' => wp_get_update_data(),
     74                ) );
    7275                ?>
    7376                <li id="accordion-section-{{ data.id }}" class="theme-section">
    7477                        <button type="button" class="customize-themes-section-title themes-section-{{ data.id }}">{{ data.title }}</button>