fix: fix positioning issue caused by long titles without line breaks

This commit is contained in:
Erzbir
2026-01-29 14:30:02 +08:00
parent 4078d88e3e
commit e8516f7182
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ async function locateToc() {
const buttonWidth = toc_toggle.offsetWidth; const buttonWidth = toc_toggle.offsetWidth;
const tocWidth = toc.classList.contains('toc-visible') ? toc.offsetWidth : buttonWidth; const tocWidth = toc.classList.contains('toc-visible') ? toc.offsetWidth : buttonWidth;
const maxLeft = screenWidth - tocWidth - 30; const maxLeft = screenWidth - content.offsetLeft - 20;
leftPosition = Math.min(leftPosition, maxLeft); leftPosition = Math.min(leftPosition, maxLeft);
leftPosition = Math.max(leftPosition, 30); leftPosition = Math.max(leftPosition, 30);
+4
View File
@@ -82,6 +82,10 @@
display: none; display: none;
} }
} }
.toc.toc-visible {
max-width: 25vw
}
} }
.toc-toggle { .toc-toggle {