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;
}
a:focus {
a:focus,
a:focus .media-icon img {
color: #124964;
-webkit-box-shadow:
0 0 0 1px #5b9dd9,
@ -530,10 +531,6 @@ code {
padding: 9px 0 22px;
}
.widefat.media .check-column {
padding-top: 8px;
}
.widefat thead td.check-column,
.widefat tbody th.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
------------------------------------------------------------------------------*/
td.media-icon {
.media-icon {
width: 62px; /* icon + border */
text-align: center;
width: 80px;
padding-top: 8px;
padding-bottom: 8px;
}
td.media-icon a {
display: inline-block;
}
td.media-icon img {
display: block;
max-width: 80px;
max-height: 60px;
width: auto;
height: auto;
.media-icon img {
border: 1px solid #e7e7e7;
border: 1px solid rgba(0, 0, 0, 0.07);
}

View File

@ -264,7 +264,8 @@ a:active {
color: #00a0d2;
}
a:focus {
a:focus,
a:focus .media-icon img {
color: #124964;
-webkit-box-shadow:
0 0 0 1px #5b9dd9,
@ -530,10 +531,6 @@ code {
padding: 9px 0 22px;
}
.widefat.media .check-column {
padding-top: 8px;
}
.widefat thead td.check-column,
.widefat tbody th.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
------------------------------------------------------------------------------*/
td.media-icon {
.media-icon {
width: 62px; /* icon + border */
text-align: center;
width: 80px;
padding-top: 8px;
padding-bottom: 8px;
}
td.media-icon a {
display: inline-block;
}
td.media-icon img {
display: block;
max-width: 80px;
max-height: 60px;
width: auto;
height: auto;
.media-icon img {
border: 1px solid #e7e7e7;
border: 1px solid rgba(0, 0, 0, 0.07);
}

View File

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

View File

@ -339,7 +339,6 @@ table.fixed {
padding-left: 3px;
}
td.column-title strong,
td.plugin-title strong {
display: block;
@ -353,27 +352,23 @@ td.plugin-title p {
}
/* Media file column */
table.media .column-title {
position: relative;
}
table.media .column-title .media-icon {
position: absolute;
top: 8px; /* match cell padding */
left: 10px; /* match cell padding */
float: left;
min-height: 60px;
margin: 0 9px 0 0;
}
table.media .column-title .media-icon img {
max-width: 60px;
height: auto;
vertical-align: top; /* Remove descender white-space. */
}
table.media .column-title .media-info,
table.media .column-title .row-actions {
margin-left: 70px; /* 60px image + margin */
}
table.media .column-title .media-info p {
table.media .column-title .filename {
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 ) {
list( $mime ) = explode( '/', $post->post_mime_type );
$user_can_edit = current_user_can( 'edit_post', $post->ID );
$att_title = _draft_or_post_title();
?>
<div class="media-icon <?php echo $mime ?>-icon">
<?php
$title = _draft_or_post_title();
$thumb = wp_get_attachment_image( $post->ID, array( 60, 60 ), true, array( 'alt' => '' ) );
$link_start = $link_end = '';
$thumb = wp_get_attachment_image( $post->ID, array( 60, 60 ), true );
if ( $thumb ) {
if ( $this->is_trash || ! $user_can_edit ) {
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
}
if ( current_user_can( 'edit_post', $post->ID ) && ! $this->is_trash ) {
$link_start = '<a href="' . get_edit_post_link( $post->ID ) . '">';
$link_end = '</a>';
}
?>
</div>
<div class="media-info">
<strong>
<?php
if ( $this->is_trash || ! $user_can_edit ) {
echo $att_title;
} 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 $att_title; ?></a><?php
}
_media_states( $post );
?>
<?php echo $link_start; ?>
<?php if ( $thumb ) : ?>
<span class="media-icon <?php echo sanitize_html_class( $mime . '-icon' ); ?>"><?php echo $thumb; ?></span>
<?php endif; ?>
<span aria-hidden="true"><?php echo $title; ?></span>
<span class="screen-reader-text"><?php printf( __( 'Edit &#8220;%s&#8221;' ), $title ); ?></span>
<?php echo $link_end; ?>
<?php _media_states( $post ); ?>
</strong>
<p class="filename"><?php echo wp_basename( $post->guid ); ?></p>
</div>
<p class="filename"><span class="screen-reader-text"><?php _e( 'File name:' ); ?> </span><?php echo wp_basename( $post->guid ); ?></p>
<?php
}

View File

@ -4,7 +4,7 @@
*
* @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.