Changeset 38889
- Timestamp:
- 10/24/2016 07:14:26 PM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/customize-controls.js
r38853 r38889 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' ); … … 1736 1736 */ 1737 1737 showDetails: function ( theme, callback ) { 1738 var section = this , link;1738 var section = this; 1739 1739 callback = callback || function(){}; 1740 1740 section.currentTheme = theme.id; … … 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 }, -
trunk/src/wp-includes/customize/class-wp-customize-theme-control.php
r38813 r38889 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> … … 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 <# } #>
Note: See TracChangeset
for help on using the changeset viewer.