Make WordPress Core

Ticket #31791: 31791.patch

File 31791.patch, 4.9 KB (added by ocean90, 11 years ago)
  • src/wp-admin/css/customize-controls.css

     
    906906        font-size: 32px;
    907907}
    908908
    909 .wp-customizer .theme-browser .theme.active .theme-name {
    910         padding-right: 15px;
    911 }
    912 
    913909.wp-customizer #themes-filter {
    914910        font-size: 16px;
    915911        font-weight: 300;
     
    917913        width: 100%;
    918914}
    919915
     916
     917.wp-customizer .theme-browser .theme.active:hover,
     918.wp-customizer .theme-browser .theme.active:focus {
     919        cursor: default;
     920}
     921
     922.wp-customizer .theme-browser .theme.active .more-details {
     923        display: none;
     924}
     925
     926.wp-customizer .theme-browser .theme.active .theme-name {
     927        padding-right: 15px;
     928}
     929
     930.wp-customizer .theme-browser.rendered .theme.active:hover .theme-screenshot img,
     931.wp-customizer .theme-browser.rendered .theme.active:focus .theme-screenshot img {
     932        opacity: 1;
     933}
     934
    920935/* Panel-like behavior */
    921936#accordion-section-themes .accordion-section-title:after {
    922937        content: "\f148";
  • src/wp-admin/includes/theme.php

     
    529529                                </div>
    530530                        </div>
    531531
    532                         <div class="theme-actions">
    533                                 <# if ( ! data.active ) { #>
     532                        <# if ( ! data.active ) { #>
     533                                <div class="theme-actions">
    534534                                        <div class="inactive-theme">
    535535                                                <a href="<?php echo add_query_arg( 'theme', '{{ data.id }}' ); ?>" target="_top" class="button button-primary"><?php _e( 'Live Preview' ); ?></a>
    536536                                        </div>
    537                                 <# } #>
    538                         </div>
     537                                </div>
     538                        <# } #>
    539539                </div>
    540540        </script>
    541541        <?php
  • src/wp-admin/js/customize-controls.js

     
    648648                                section.closeDetails();
    649649                        });
    650650
    651                         section.container.on( 'click keydown', '.theme-actions .button', function( event ) {
    652                                 if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
    653                                         return;
    654                                 }
    655 
    656                                 $( '.wp-full-overlay' ).addClass( 'customize-loading' );
    657                         });
    658 
    659651                        section.container.on( 'input', '#themes-filter', function( event ) {
    660652                                var count,
    661653                                        term = event.currentTarget.value.toLowerCase().trim().replace( '-', ' ' ),
     
    18851877                                        return;
    18861878                                }
    18871879
    1888                                 api.section( control.section() ).showDetails( control.params.theme );
     1880                                if ( $( this ).hasClass( 'active' ) ) {
     1881                                        return;
     1882                                }
     1883
     1884                                var previewUrl = $( this ).data( 'previewUrl' );
     1885
     1886                                $( '.wp-full-overlay' ).addClass( 'customize-loading' );
     1887
     1888                                window.parent.location = previewUrl;
    18891889                        });
    18901890
    1891                         control.container.on( 'click keydown', '.theme-actions .button', function( event ) {
     1891                        control.container.on( 'click keydown', '.theme-actions .theme-details', function( event ) {
    18921892                                if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
    18931893                                        return;
    18941894                                }
    18951895
    1896                                 $( '.wp-full-overlay' ).addClass( 'customize-loading' );
     1896                                event.preventDefault(); // Keep this AFTER the key filter above
     1897
     1898                                api.section( control.section() ).showDetails( control.params.theme );
    18971899                        });
    18981900                },
    18991901
  • src/wp-includes/class-wp-customize-control.php

     
    12001200         * @since 4.2.0
    12011201         */
    12021202        public function content_template() {
    1203         ?>
    1204                 <div class="theme<# if ( data.theme.active ) { #> active<# } #>" tabindex="0" aria-describedby="{{ data.theme.id }}-action {{ data.theme.id }}-name">
     1203                $preview_url = site_url( add_query_arg( 'theme', '{{ data.theme.id }}' ) );
     1204                ?>
     1205                <div class="theme<# if ( data.theme.active ) { #> active<# } #>" data-preview-url="<?php echo esc_attr( $preview_url ); ?>" aria-describedby="{{ data.theme.id }}-action {{ data.theme.id }}-name">
    12051206                        <# if ( data.theme.screenshot[0] ) { #>
    12061207                                <div class="theme-screenshot">
    12071208                                        <img src="{{ data.theme.screenshot[0] }}" alt="" />
     
    12091210                        <# } else { #>
    12101211                                <div class="theme-screenshot blank"></div>
    12111212                        <# } #>
    1212                         <span class="more-details" id="{{ data.theme.id }}-action"><?php _e( 'Theme Details' ); ?></span>
     1213                        <span class="more-details" id="{{ data.theme.id }}-action"><?php _e( 'Live Preview' ); ?></span>
    12131214                        <div class="theme-author"><?php printf( __( 'By %s' ), '{{ data.theme.author }}' ); ?></div>
    12141215
    12151216                        <# if ( data.theme.active ) { #>
     
    12251226
    12261227                        <# if ( ! data.theme.active ) { #>
    12271228                                <div class="theme-actions">
    1228                                         <a class="button" href="<?php echo add_query_arg( 'theme', '{{ data.theme.id }}' ); ?>" target="_top"><?php _e( 'Live Preview' ); ?></a>
     1229                                        <button type="button" class="button theme-details"><?php _e( 'Theme Details' ); ?></button>
    12291230                                </div>
    12301231                        <# } #>
    12311232                </div>