mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-09-02 19:52:40 +00:00
🐛 Fix: toc empty error
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
padding-right: 1rem;
|
||||
@include overflow-wrap(break-word);
|
||||
box-sizing: border-box;
|
||||
visibility: hidden;
|
||||
visibility: hidden; // TODO use animateCSS instead
|
||||
|
||||
@include blur;
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+5
-4
@@ -487,11 +487,10 @@ class Theme {
|
||||
}
|
||||
|
||||
initToc() {
|
||||
const $toc = document.getElementById('toc-auto');
|
||||
if ($toc === null) {
|
||||
const $tocCore = document.getElementById('TableOfContents');
|
||||
if ($tocCore === null) {
|
||||
return;
|
||||
}
|
||||
const $tocCore = document.getElementById('TableOfContents');
|
||||
if (
|
||||
document.getElementById('toc-static').getAttribute('kept') === 'true' ||
|
||||
this.util.isTocStatic()
|
||||
@@ -508,7 +507,8 @@ class Theme {
|
||||
$tocCore.parentElement.removeChild($tocCore);
|
||||
$tocContentAuto.appendChild($tocCore);
|
||||
}
|
||||
$toc.style.visibility = 'visible';
|
||||
const $toc = document.getElementById('toc-auto');
|
||||
$toc.style.visibility = 'visible'; // TODO use animateCSS instead
|
||||
$toc.style.marginTop =
|
||||
document.querySelector('.single-title').clientHeight +
|
||||
document.querySelector('.post-meta').clientHeight +
|
||||
@@ -947,6 +947,7 @@ class Theme {
|
||||
this._resizeTimeout = window.setTimeout(() => {
|
||||
this._resizeTimeout = null;
|
||||
for (let event of this.resizeEventSet) event();
|
||||
this.initToc();
|
||||
this.initMermaid();
|
||||
this.initSearch();
|
||||
}, 100);
|
||||
|
||||
Reference in New Issue
Block a user