Fix league table alignment and responsive height

This commit is contained in:
Brian Miyaji
2014-05-31 10:42:53 +10:00
parent 2d02d42f8f
commit 157dd465d1
2 changed files with 22 additions and 6 deletions

View File

@@ -78,10 +78,21 @@
}
/* League Table */
.sp-league-table .team-logo {
vertical-align: middle;
height: 2.5em;
.sp-league-table td {
line-height: 2em;
}
.sp-league-table .data-name.has-logo {
padding-left: 2.5em;
position: relative;
}
.sp-league-table .data-name.has-logo .team-logo {
width: auto;
height: auto;
max-width: 2em;
max-height: 2em;
position: absolute;
left: 0.25em;
}
/* Event Performance */

View File

@@ -72,9 +72,14 @@ foreach( $data as $team_id => $row ):
// Rank
$output .= '<td class="data-rank">' . ( $i + 1 ) . '</td>';
$name_class = '';
if ( $show_team_logo ):
$logo = get_the_post_thumbnail( $team_id, 'sportspress-fit-icon', array( 'class' => 'team-logo' ) );
$name = $logo . ' ' . $name;
if ( has_post_thumbnail( $team_id ) ):
$logo = get_the_post_thumbnail( $team_id, 'sportspress-fit-icon', array( 'class' => 'team-logo' ) );
$name = $logo . ' ' . $name;
$name_class .= ' has-logo';
endif;
endif;
if ( $link_posts ):
@@ -82,7 +87,7 @@ foreach( $data as $team_id => $row ):
$name = '<a href="' . $permalink . '">' . $name . '</a>';
endif;
$output .= '<td class="data-name">' . $name . '</td>';
$output .= '<td class="data-name' . $name_class . '">' . $name . '</td>';
foreach( $labels as $key => $value ):
if ( $key == 'name' )