Make WordPress Core

Changeset 20940


Ignore:
Timestamp:
05/26/2012 08:47:55 PM (14 years ago)
Author:
koopersmith
Message:

Theme Customizer: Don't expand theme title if there are no details to show. props nacin, fixes #20757, see #19910.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/customize.php

    r20899 r20940  
    6161                </div>
    6262
     63                <?php
     64                        $screenshot = $wp_customize->theme()->get_screenshot();
     65                        $cannot_expand = ! ( $screenshot || $wp_customize->theme()->get('Description') );
     66                ?>
     67
    6368                <div class="wp-full-overlay-sidebar-content">
    64                         <div id="customize-info" class="customize-section">
     69                        <div id="customize-info" class="customize-section<?php if ( $cannot_expand ) echo ' cannot-expand'; ?>">
    6570                                <div class="customize-section-title">
    6671                                        <span class="preview-notice"><?php _e('You are previewing'); ?></span>
    6772                                        <strong class="theme-name"><?php echo $wp_customize->theme()->display('Name'); ?></strong>
    6873                                </div>
     74                                <?php if ( ! $cannot_expand ) : ?>
    6975                                <div class="customize-section-content">
    70                                         <?php if ( $screenshot = $wp_customize->theme()->get_screenshot() ) : ?>
     76                                        <?php if ( $screenshot ) : ?>
    7177                                                <img class="theme-screenshot" src="<?php echo esc_url( $screenshot ); ?>" />
    7278                                        <?php endif; ?>
     
    7682                                        <?php endif; ?>
    7783                                </div>
     84                                <?php endif; ?>
    7885                        </div>
    7986
  • trunk/wp-includes/css/customize-controls.dev.css

    r20936 r20940  
    2727        -moz-user-select: none;
    2828        user-select: none;
     29}
     30
     31.cannot-expand .customize-section-title {
     32        cursor: auto;
    2933}
    3034
     
    8387        right: 20px;
    8488        z-index: 1;
     89}
     90
     91.cannot-expand .customize-section-title:after {
     92        display: none;
    8593}
    8694
  • trunk/wp-includes/js/customize-controls.dev.js

    r20936 r20940  
    595595
    596596                // Temporary accordion code.
    597                 $('.customize-section-title').click( function() {
     597                $('.customize-section-title').click( function( event ) {
    598598                        var clicked = $( this ).parents( '.customize-section' );
     599
     600                        if ( clicked.hasClass('cannot-expand') )
     601                                return;
     602
    599603                        $( '.customize-section' ).not( clicked ).removeClass( 'open' );
    600604                        clicked.toggleClass( 'open' );
    601                         return false;
     605                        event.preventDefault();
    602606                });
    603607
Note: See TracChangeset for help on using the changeset viewer.