fix: make TOC title and entries visible at the same time (#1711)

When internet connection speeds are poor, there is a chance that the title of the TOC will appear earlier than its entries, causing a visual cutoff.
This commit is contained in:
Cotes Chung 2024-04-29 03:36:16 +08:00 committed by GitHub
parent 778ebdf250
commit e0950fc973
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -6,8 +6,8 @@
{% endif %}
{% if enable_toc %}
<section id="toc-wrapper" class="ps-0 pe-4">
<h2 class="panel-heading ps-3 pt-2 mb-2">{{- site.data.locales[include.lang].panel.toc -}}</h2>
<section id="toc-wrapper" class="d-none ps-0 pe-4">
<h2 class="panel-heading ps-3 mb-2">{{- site.data.locales[include.lang].panel.toc -}}</h2>
<nav id="toc"></nav>
</section>
{% endif %}

View file

@ -9,5 +9,7 @@ export function toc() {
orderedList: false,
scrollSmooth: false
});
document.getElementById('toc-wrapper').classList.remove('d-none');
}
}