Ticket #38475: 38475.diff
File 38475.diff, 2.9 KB (added by , 8 years ago) |
---|
-
src/wp-admin/js/customize-controls.js
1186 1186 1187 1187 // Preview installed themes. 1188 1188 section.container.on( 'click', '.theme-actions .preview-theme', function() { 1189 var themeId = $( this ).data( ' themeId' );1189 var themeId = $( this ).data( 'slug' ); 1190 1190 1191 1191 $( '.wp-full-overlay' ).addClass( 'customize-loading' ); 1192 1192 api.panel( 'themes' ).loadThemePreview( themeId ).fail( function() { … … 1745 1745 section.containFocus( section.overlay ); 1746 1746 section.updateLimits(); 1747 1747 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 } );1763 1748 callback(); 1764 1749 }, 1765 1750 -
src/wp-includes/customize/class-wp-customize-theme-control.php
106 106 <# } else if ( 'installed' === data.theme.type ) { #> 107 107 <h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">{{ data.theme.name }}</h3> 108 108 <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> 110 110 </div> 111 111 <div class="notice notice-success notice-alt"><p><?php _e( 'Installed' ); ?></p></div> 112 112 <# } else { #> 113 113 <h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">{{ data.theme.name }}</h3> 114 114 <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> 116 116 </div> 117 117 <# } #> 118 118 </div>