Skip to content

Commit

Permalink
fix: make TOC title and entries visible at the same time (#1711)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cotes2020 authored Apr 28, 2024
1 parent 778ebdf commit e0950fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _includes/toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
2 changes: 2 additions & 0 deletions _javascript/modules/components/toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ export function toc() {
orderedList: false,
scrollSmooth: false
});

document.getElementById('toc-wrapper').classList.remove('d-none');
}
}

0 comments on commit e0950fc

Please sign in to comment.