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