Fix responsive league table behavior
This commit is contained in:
@@ -36,7 +36,7 @@ if ( !function_exists( 'sportspress_league_table' ) ) {
|
||||
if ( ! is_array( $columns ) )
|
||||
$columns = explode( ',', $columns );
|
||||
|
||||
$output .= '<th class="data-number">' . __( 'Pos', 'sportspress' ) . '</th>';
|
||||
$output .= '<th class="data-rank">' . __( 'Pos', 'sportspress' ) . '</th>';
|
||||
|
||||
foreach( $labels as $key => $label ):
|
||||
if ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) )
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
}
|
||||
.sp-responsive-table .data-number,
|
||||
.sp-responsive-table .data-name,
|
||||
.sp-responsive-table .data-rank,
|
||||
.sp-responsive-.sp-pinned-table td {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ function viewport() {
|
||||
original.wrap("<div class='sp-responsive-table-wrapper' />");
|
||||
|
||||
var copy = original.clone();
|
||||
copy.find("td:not(.data-number):not(.data-name), th:not(.data-number):not(.data-name)").css("display", "none");
|
||||
copy.find("td:not(.data-number):not(.data-name):not(.data-rank), th:not(.data-number):not(.data-name):not(.data-rank)").css("display", "none");
|
||||
copy.removeClass("sp-responsive-table");
|
||||
|
||||
original.closest(".sp-responsive-table-wrapper").append(copy);
|
||||
|
||||
Reference in New Issue
Block a user