Media: Reduce link noise between icons and titles in list view.

Props afercia.
Fixes #32254.


Built from https://develop.svn.wordpress.org/trunk@33268


git-svn-id: http://core.svn.wordpress.org/trunk@33240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Konstantin Obenland 2015-07-14 17:24:26 +00:00
parent 9de28a2e04
commit 2a0ddf8523
8 changed files with 43 additions and 93 deletions

View File

@ -264,7 +264,8 @@ a:active {
color: #00a0d2; color: #00a0d2;
} }
a:focus { a:focus,
a:focus .media-icon img {
color: #124964; color: #124964;
-webkit-box-shadow: -webkit-box-shadow:
0 0 0 1px #5b9dd9, 0 0 0 1px #5b9dd9,
@ -530,10 +531,6 @@ code {
padding: 9px 0 22px; padding: 9px 0 22px;
} }
.widefat.media .check-column {
padding-top: 8px;
}
.widefat thead td.check-column, .widefat thead td.check-column,
.widefat tbody th.check-column, .widefat tbody th.check-column,
.widefat tfoot td.check-column { .widefat tfoot td.check-column {
@ -2029,23 +2026,12 @@ body.iframe {
/* - Only used once or twice in all of WP - deprecate for global style /* - Only used once or twice in all of WP - deprecate for global style
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
td.media-icon { .media-icon {
width: 62px; /* icon + border */
text-align: center; text-align: center;
width: 80px;
padding-top: 8px;
padding-bottom: 8px;
} }
td.media-icon a { .media-icon img {
display: inline-block;
}
td.media-icon img {
display: block;
max-width: 80px;
max-height: 60px;
width: auto;
height: auto;
border: 1px solid #e7e7e7; border: 1px solid #e7e7e7;
border: 1px solid rgba(0, 0, 0, 0.07); border: 1px solid rgba(0, 0, 0, 0.07);
} }

View File

@ -264,7 +264,8 @@ a:active {
color: #00a0d2; color: #00a0d2;
} }
a:focus { a:focus,
a:focus .media-icon img {
color: #124964; color: #124964;
-webkit-box-shadow: -webkit-box-shadow:
0 0 0 1px #5b9dd9, 0 0 0 1px #5b9dd9,
@ -530,10 +531,6 @@ code {
padding: 9px 0 22px; padding: 9px 0 22px;
} }
.widefat.media .check-column {
padding-top: 8px;
}
.widefat thead td.check-column, .widefat thead td.check-column,
.widefat tbody th.check-column, .widefat tbody th.check-column,
.widefat tfoot td.check-column { .widefat tfoot td.check-column {
@ -2029,23 +2026,12 @@ body.iframe {
/* - Only used once or twice in all of WP - deprecate for global style /* - Only used once or twice in all of WP - deprecate for global style
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
td.media-icon { .media-icon {
width: 62px; /* icon + border */
text-align: center; text-align: center;
width: 80px;
padding-top: 8px;
padding-bottom: 8px;
} }
td.media-icon a { .media-icon img {
display: inline-block;
}
td.media-icon img {
display: block;
max-width: 80px;
max-height: 60px;
width: auto;
height: auto;
border: 1px solid #e7e7e7; border: 1px solid #e7e7e7;
border: 1px solid rgba(0, 0, 0, 0.07); border: 1px solid rgba(0, 0, 0, 0.07);
} }

View File

@ -339,7 +339,6 @@ table.fixed {
padding-right: 3px; padding-right: 3px;
} }
td.column-title strong, td.column-title strong,
td.plugin-title strong { td.plugin-title strong {
display: block; display: block;
@ -353,27 +352,23 @@ td.plugin-title p {
} }
/* Media file column */ /* Media file column */
table.media .column-title {
position: relative;
}
table.media .column-title .media-icon { table.media .column-title .media-icon {
position: absolute; float: right;
top: 8px; /* match cell padding */ min-height: 60px;
right: 10px; /* match cell padding */ margin: 0 0 0 9px;
} }
table.media .column-title .media-icon img { table.media .column-title .media-icon img {
max-width: 60px; max-width: 60px;
height: auto; height: auto;
vertical-align: top; /* Remove descender white-space. */
} }
table.media .column-title .media-info,
table.media .column-title .row-actions { table.media .column-title .row-actions {
margin-right: 70px; /* 60px image + margin */ margin-right: 70px; /* 60px image + margin */
} }
table.media .column-title .media-info p { table.media .column-title .filename {
margin-bottom: 0.2em; margin-bottom: 0.2em;
} }

View File

@ -339,7 +339,6 @@ table.fixed {
padding-left: 3px; padding-left: 3px;
} }
td.column-title strong, td.column-title strong,
td.plugin-title strong { td.plugin-title strong {
display: block; display: block;
@ -353,27 +352,23 @@ td.plugin-title p {
} }
/* Media file column */ /* Media file column */
table.media .column-title {
position: relative;
}
table.media .column-title .media-icon { table.media .column-title .media-icon {
position: absolute; float: left;
top: 8px; /* match cell padding */ min-height: 60px;
left: 10px; /* match cell padding */ margin: 0 9px 0 0;
} }
table.media .column-title .media-icon img { table.media .column-title .media-icon img {
max-width: 60px; max-width: 60px;
height: auto; height: auto;
vertical-align: top; /* Remove descender white-space. */
} }
table.media .column-title .media-info,
table.media .column-title .row-actions { table.media .column-title .row-actions {
margin-left: 70px; /* 60px image + margin */ margin-left: 70px; /* 60px image + margin */
} }
table.media .column-title .media-info p { table.media .column-title .filename {
margin-bottom: 0.2em; margin-bottom: 0.2em;
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -338,40 +338,28 @@ class WP_Media_List_Table extends WP_List_Table {
public function column_title( $post ) { public function column_title( $post ) {
list( $mime ) = explode( '/', $post->post_mime_type ); list( $mime ) = explode( '/', $post->post_mime_type );
$user_can_edit = current_user_can( 'edit_post', $post->ID ); $title = _draft_or_post_title();
$att_title = _draft_or_post_title(); $thumb = wp_get_attachment_image( $post->ID, array( 60, 60 ), true, array( 'alt' => '' ) );
?> $link_start = $link_end = '';
<div class="media-icon <?php echo $mime ?>-icon">
<?php
$thumb = wp_get_attachment_image( $post->ID, array( 60, 60 ), true ); if ( current_user_can( 'edit_post', $post->ID ) && ! $this->is_trash ) {
if ( $thumb ) { $link_start = '<a href="' . get_edit_post_link( $post->ID ) . '">';
if ( $this->is_trash || ! $user_can_edit ) { $link_end = '</a>';
echo $thumb;
} else { ?>
<a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php
echo esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $att_title ) );
?>"><?php echo $thumb; ?></a><?php
}
} }
?> ?>
</div>
<div class="media-info">
<strong> <strong>
<?php <?php echo $link_start; ?>
if ( $this->is_trash || ! $user_can_edit ) { <?php if ( $thumb ) : ?>
echo $att_title; <span class="media-icon <?php echo sanitize_html_class( $mime . '-icon' ); ?>"><?php echo $thumb; ?></span>
} else { ?> <?php endif; ?>
<a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php
echo esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $att_title ) ); <span aria-hidden="true"><?php echo $title; ?></span>
?>"><?php echo $att_title; ?></a><?php <span class="screen-reader-text"><?php printf( __( 'Edit &#8220;%s&#8221;' ), $title ); ?></span>
} <?php echo $link_end; ?>
_media_states( $post ); <?php _media_states( $post ); ?>
?>
</strong> </strong>
<p class="filename"><?php echo wp_basename( $post->guid ); ?></p> <p class="filename"><span class="screen-reader-text"><?php _e( 'File name:' ); ?> </span><?php echo wp_basename( $post->guid ); ?></p>
</div>
<?php <?php
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.3-beta2-33267'; $wp_version = '4.3-beta2-33268';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.