Настройка: меню разделов не прыгает, другой раздел открывается с начала
- Место под полосу прокрутки зарезервировано всегда (scrollbar-gutter: stable): короткий раздел без прокрутки и длинный с ней больше не сдвигают страницу и меню вбок. - Меню разделов — на месте при прокрутке и целиком на экране (своя прокрутка, если не помещается по высоте). - Выбор другого раздела — страница с его начала, а не с той высоты, где листали прежний (после сохранения формы — как раньше, к месту формы). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014FsEKyJrYF69Cj9ZXzFLRi
This commit is contained in:
@@ -1176,7 +1176,8 @@
|
||||
try { sessionStorage.setItem('bj-setup-tab', id); } catch(e) {}
|
||||
try { history.replaceState(null, '', '#' + id); } catch(e) {}
|
||||
}
|
||||
navs.forEach(function(b){ b.addEventListener('click', function(){ show(b.dataset.sec); }); });
|
||||
// выбрали другой раздел — с его начала, а не с той же высоты, где листали прежний
|
||||
navs.forEach(function(b){ b.addEventListener('click', function(){ var same=b.classList.contains('active'); show(b.dataset.sec); if(!same) window.scrollTo(0,0); }); });
|
||||
var h = (location.hash || '').replace('#','');
|
||||
// Хэш в URL имеет приоритет. Иначе — после сохранения (есть ?flash/?scrollto)
|
||||
// восстанавливаем последнюю вкладку из sessionStorage.
|
||||
|
||||
@@ -47,6 +47,8 @@
|
||||
.num, .stat-value, .clock, td .id, .mono { font-variant-numeric:tabular-nums; }
|
||||
* { box-sizing: border-box; }
|
||||
html, body { margin:0; padding:0; }
|
||||
/* место под полосу прокрутки — всегда: короткий и длинный раздел не сдвигают страницу вбок */
|
||||
html { scrollbar-gutter:stable; }
|
||||
body {
|
||||
font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
||||
background: var(--bg); color: var(--text); line-height: 1.5;
|
||||
@@ -258,7 +260,7 @@ label { font-size:13px; font-weight:500; }
|
||||
.settings-section, .settings-section .card { min-width:0; }
|
||||
.settings-section table { max-width:100%; }
|
||||
.tw { overflow-x:auto; max-width:100%; }
|
||||
.settings-nav { position:sticky; top:78px; display:flex; flex-direction:column; gap:2px; }
|
||||
.settings-nav { position:sticky; top:78px; display:flex; flex-direction:column; gap:2px; max-height:calc(100vh - 96px); overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; }
|
||||
.settings-nav button {
|
||||
display:flex; align-items:center; gap:11px; justify-content:flex-start;
|
||||
background:transparent; border:1px solid transparent; color:var(--text-2);
|
||||
@@ -409,7 +411,7 @@ label { font-size:13px; font-weight:500; }
|
||||
@media (max-width:700px){.org-grid{grid-template-columns:minmax(0,1fr)}}
|
||||
@media (max-width:820px) {
|
||||
.settings { grid-template-columns:1fr; }
|
||||
.settings-nav { flex-direction:row; overflow-x:auto; position:static; padding-bottom:8px; }
|
||||
.settings-nav { flex-direction:row; overflow-x:auto; position:static; padding-bottom:8px; max-height:none; overflow-y:visible; }
|
||||
.settings-nav button { white-space:nowrap; width:auto; }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user