WordPress.org

Make WordPress Core

Changeset 32687


Ignore:
Timestamp:
06/03/2015 03:12:19 PM (4 years ago)
Author:
helen
Message:

Media: move the thumbnail into the title column in list view.

This gives us more space for the title and row actions, and will make a responsive list table enhancement significantly easier.

props bradt for the initial patch.
fixes #29993 and #32255. see #32509 and #32395.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/list-tables.css

    r32521 r32687  
    297297}
    298298
    299 .fixed .column-icon {
    300     width: 80px;
     299/* Media file column */
     300table.media .column-title {
     301    position: relative;
     302}
     303
     304table.media .column-title .media-icon {
     305    position: absolute;
     306    top: 8px; /* match cell padding */
     307    left: 10px; /* match cell padding */
     308}
     309
     310table.media .column-title .media-info,
     311table.media .column-title .row-actions {
     312    margin-left: 70px; /* 60px image + margin */
    301313}
    302314
     
    16231635    .tags .column-description,
    16241636    .media .column-parent,
     1637    .media .column-comments,
    16251638    .users .column-email,
    16261639    .users .column-name,
     
    16491662    .widefat * {
    16501663        word-wrap: normal;
     1664    }
     1665
     1666    /* Media */
     1667    .media .column-title {
     1668        width: auto;
    16511669    }
    16521670
  • trunk/src/wp-admin/includes/class-wp-media-list-table.php

    r32663 r32687  
    248248        $posts_columns = array();
    249249        $posts_columns['cb'] = '<input type="checkbox" />';
    250         $posts_columns['icon'] = '';
    251250        /* translators: column name */
    252251        $posts_columns['title'] = _x( 'File', 'column name' );
     
    362361
    363362        switch ( $column_name ) {
    364             case 'icon':
     363            case 'title':
    365364                list( $mime ) = explode( '/', $post->post_mime_type );
    366                 $attributes = 'class="column-icon media-icon ' . $mime . '-icon"' . $style;
     365
     366                echo "<div class='media-icon {$mime}-icon'>";
    367367
    368368                if ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) {
     
    375375                    }
    376376                }
    377                 break;
    378 
    379             case 'title':
     377
     378                echo '</div><div class="media-info">';
    380379?>
    381380                    <strong>
     
    389388                    _media_states( $post ); ?></strong>
    390389                    <p class="filename"><?php echo wp_basename( $post->guid ); ?></p>
     390                </div>
    391391<?php
    392392                break;
Note: See TracChangeset for help on using the changeset viewer.