Fix mobile layout; scroll tables themselves, not cards

This commit is contained in:
2026-09-17 22:13:56 +03:00
parent 3c40ffb11d
commit 0bb55e6e4b
3 changed files with 42 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
/* Прокрутка только самой таблицы, а не всей карточки.
Оборачиваем таблицы в .table-scroll-box; таблицы в markdown-статьях
уже обёрнуты сервером (.table-scroll) и пропускаются. */
(function () {
function wrap(table) {
if (table.closest('.table-scroll, .table-scroll-box')) return;
if (table.closest('.md-body')) return;
var box = document.createElement('div');
box.className = 'table-scroll-box';
table.parentNode.insertBefore(box, table);
box.appendChild(table);
}
function ready() {
document.querySelectorAll('table').forEach(wrap);
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', ready);
} else {
ready();
}
})();