Make WordPress Core

Ticket #38475: 38475.diff

File 38475.diff, 2.9 KB (added by celloexpressions, 8 years ago)
  • src/wp-admin/js/customize-controls.js

     
    11861186
    11871187                        // Preview installed themes.
    11881188                        section.container.on( 'click', '.theme-actions .preview-theme', function() {
    1189                                 var themeId = $( this ).data( 'themeId' );
     1189                                var themeId = $( this ).data( 'slug' );
    11901190
    11911191                                $( '.wp-full-overlay' ).addClass( 'customize-loading' );
    11921192                                api.panel( 'themes' ).loadThemePreview( themeId ).fail( function() {
     
    17451745                        section.containFocus( section.overlay );
    17461746                        section.updateLimits();
    17471747                        wp.a11y.speak( api.settings.l10n.announceThemeDetails.replace( '%s', theme.name ) );
    1748 
    1749                         link = section.overlay.find( '.inactive-theme > a' );
    1750                         link.on( 'click', function( event ) {
    1751                                 event.preventDefault();
    1752 
    1753                                 // Short-circuit if request is currently being made.
    1754                                 if ( link.hasClass( 'disabled' ) ) {
    1755                                         return;
    1756                                 }
    1757                                 link.addClass( 'disabled' );
    1758 
    1759                                 api.panel( 'themes' ).loadThemePreview( theme.id ).fail( function() {
    1760                                         link.removeClass( 'disabled' );
    1761                                 } );
    1762                         } );
    17631748                        callback();
    17641749                },
    17651750
  • src/wp-includes/customize/class-wp-customize-theme-control.php

     
    106106                        <# } else if ( 'installed' === data.theme.type ) { #>
    107107                                <h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">{{ data.theme.name }}</h3>
    108108                                <div class="theme-actions">
    109                                         <button type="button" class="button button-primary preview-theme" aria-label="<?php echo esc_attr( $preview_label ); ?>" data-theme-id="{{ data.theme.id }}"><?php _e( 'Live Preview' ); ?></span>
     109                                        <button type="button" class="button button-primary preview-theme" aria-label="<?php echo esc_attr( $preview_label ); ?>" data-slug="{{ data.theme.id }}"><?php _e( 'Live Preview' ); ?></span>
    110110                                </div>
    111111                                <div class="notice notice-success notice-alt"><p><?php _e( 'Installed' ); ?></p></div>
    112112                        <# } else { #>
    113113                                <h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">{{ data.theme.name }}</h3>
    114114                                <div class="theme-actions">
    115                                         <button type="button" class="button button-primary theme-install preview" aria-label="<?php echo esc_attr( $install_label ); ?>" data-slug="{{ data.theme.id }}" data-name="{{ data.theme.name }}" data-theme-id="{{ data.theme.id }}"><?php _e( 'Install & Preview' ); ?></button>
     115                                        <button type="button" class="button button-primary theme-install preview" aria-label="<?php echo esc_attr( $install_label ); ?>" data-slug="{{ data.theme.id }}" data-name="{{ data.theme.name }}"><?php _e( 'Install & Preview' ); ?></button>
    116116                                </div>
    117117                        <# } #>
    118118                </div>