8000 fix: make TOC title and entries visible at the same time (#1711) · Goder-0/goder-0.github.io@e0950fc · GitHub
[go: up one dir, main page]

Skip to content

Commit e0950fc

Browse files
authored
fix: make TOC title and entries visible at the same time (cotes2020#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.
1 parent 778ebdf commit e0950fc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

_includes/toc.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
{% endif %}
77

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

_javascript/modules/components/toc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ export function toc() {
99
orderedList: false,
1010
scrollSmooth: false
1111
});
12+
13+
document.getElementById('toc-wrapper').classList.remove('d-none');
1214
}
1315
}

0 commit comments

Comments
 (0)
0