Make WordPress Core


Ignore:
Timestamp:
05/12/2016 08:22:45 PM (10 years ago)
Author:
westonruter
Message:

Customize: Clean up media control CSS.

Removes unnecessary wrapper elements and refactors class names to eliminate duplication of rule selectors.

Props celloexpressions.
Fixes #30618.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/customize/class-wp-customize-site-icon-control.php

    r37229 r37426  
    6161
    6262                <# if ( data.attachment && data.attachment.id ) { #>
    63                 <div class="current">
    64                         <div class="container">
     63                        <div class="attachment-media-view">
    6564                                <div class="site-icon-preview">
    6665                                        <div class="favicon-preview">
     
    7473                                        <img class="app-icon-preview" src="{{ data.attachment.sizes.full.url }}" alt="<?php esc_attr_e( 'Preview as an app icon' ); ?>"/>
    7574                                </div>
    76                         </div>
    77                 </div>
    78                 <div class="actions">
    79                         <# if ( data.canUpload ) { #>
    80                                 <button type="button" class="button remove-button"><?php echo $this->button_labels['remove']; ?></button>
    81                                 <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['change']; ?></button>
    82                                 <div style="clear:both"></div>
    83                         <# } #>
    84                 </div>
    85                 <# } else { #>
    86                 <div class="current">
    87                         <div class="container">
    88                                 <div class="placeholder">
    89                                         <div class="inner">
    90                                                 <span><?php echo $this->button_labels['placeholder']; ?></span>
    91                                         </div>
     75                                <div class="actions">
     76                                        <# if ( data.canUpload ) { #>
     77                                                <button type="button" class="button remove-button"><?php echo $this->button_labels['remove']; ?></button>
     78                                                <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['change']; ?></button>
     79                                                <div style="clear:both"></div>
     80                                        <# } #>
    9281                                </div>
    9382                        </div>
    94                 </div>
    95                 <div class="actions">
    96                         <# if ( data.defaultAttachment ) { #>
    97                                 <button type="button" class="button default-button"><?php echo $this->button_labels['default']; ?></button>
    98                         <# } #>
    99                         <# if ( data.canUpload ) { #>
    100                                 <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['select']; ?></button>
    101                         <# } #>
    102                         <div style="clear:both"></div>
    103                 </div>
     83                <# } else { #>
     84                        <div class="attachment-media-view">
     85                                <div class="placeholder">
     86                                        <?php echo $this->button_labels['placeholder']; ?>
     87                                </div>
     88                                <div class="actions">
     89                                        <# if ( data.defaultAttachment ) { #>
     90                                                <button type="button" class="button default-button"><?php echo $this->button_labels['default']; ?></button>
     91                                        <# } #>
     92                                        <# if ( data.canUpload ) { #>
     93                                                <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['select']; ?></button>
     94                                        <# } #>
     95                                        <div style="clear:both"></div>
     96                                </div>
     97                        </div>
    10498                <# } #>
    10599                <?php
Note: See TracChangeset for help on using the changeset viewer.