Skip to content

Commit c2dd97c

Browse files
xercsy-records
andauthored
Optimize style of supported-versions table on mobile (#1243)
Co-authored-by: Luffy <[email protected]>
1 parent b8d9b90 commit c2dd97c

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

js/common.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -828,15 +828,12 @@ function getLanguage() {
828828
*/
829829
$(document).ready(function () {
830830
$('table').each(function () {
831-
var $table = $(this);
832-
$table.find('th').each(function (index) {
833-
var $th = $(this);
834-
var text = $th.text();
835-
if (text === '') {
836-
return;
837-
}
838-
$table.find('td:nth-child(' + (index + 1) + ')')
839-
.attr('data-label', text);
831+
var $columns = $(this).find('td:not(.collapse-phone)');
832+
var $headers = $(this).find('th');
833+
$headers.each(function (index) {
834+
$columns.filter(function (counter) {
835+
return index === counter % $headers.length;
836+
}).attr('data-label', $(this).text());
840837
});
841838
});
842839
});

styles/supported-versions.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ table.standard tr.stable td:first-child {
1919
}
2020

2121
table.standard td.collapse-phone {
22-
padding: 0;
22+
display: none;
2323
}
2424

25-
table.standard td.collapse-phone * {
26-
display: none;
25+
table.standard:nth-of-type(2) td::before {
26+
content: unset;
2727
}
2828
}
2929

0 commit comments

Comments
 (0)