Merge pull request #8 from Erzbir/fix-toc
fix: fix positioning issue caused by long titles without line breaks
This commit is contained in:
+1
-1
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,10 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.toc.toc-visible {
|
||||||
|
max-width: 25vw
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.toc-toggle {
|
.toc-toggle {
|
||||||
|
|||||||
Reference in New Issue
Block a user