Remove unused element variable

This commit is contained in:
Helen Chong 2024-04-16 00:47:32 +08:00
parent 1230880e84
commit b55b75e630
1 changed files with 1 additions and 2 deletions

View File

@ -53,7 +53,6 @@
<script defer> <script defer>
// Close article ToC accordion for small screen sizes // Close article ToC accordion for small screen sizes
const tocWrapper = docucument.querySelector('.toc__wrapper'); const tocWrapper = docucument.querySelector('.toc__wrapper');
const tocEl = docucument.querySelector('.toc');
if (window.innerWidth < 480) { if (window.innerWidth < 480) {
tocWrapper.removeAttribute("open"); tocWrapper.removeAttribute("open");
} else { } else {
@ -62,7 +61,7 @@
// Remove the stickiness of the sidebar ToC if it is larger than screen height // Remove the stickiness of the sidebar ToC if it is larger than screen height
function preventSidebarOverflow() { function preventSidebarOverflow() {
if (document.documentElement.clientHeight < tocEl.offsetHeight + 50) { if (document.documentElement.clientHeight < tocWrapper.offsetHeight + 50) {
tocWrapper.style.marginTop = "0"; tocWrapper.style.marginTop = "0";
tocWrapper.style.position = "static"; tocWrapper.style.position = "static";
} }