mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-09-03 04:02:40 +00:00
🐛 Fix: toc margin bottom calculate error
This commit is contained in:
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
@@ -496,7 +496,7 @@ enableEmoji = true
|
||||
images = ["/logo.png"]
|
||||
# enable PWA since v0.2.12
|
||||
# 开启 PWA 支持 since v0.2.12
|
||||
enablePWA = false
|
||||
enablePWA = true
|
||||
|
||||
# Header config
|
||||
# 页面头部导航栏配置
|
||||
|
||||
+6
-4
@@ -513,10 +513,7 @@ class Theme {
|
||||
document.querySelector('.single-title').clientHeight +
|
||||
document.querySelector('.post-meta').clientHeight +
|
||||
'px';
|
||||
$toc.style.marginBottom =
|
||||
document.getElementById('post-footer').clientHeight +
|
||||
document.getElementById('comments').clientHeight +
|
||||
'px';
|
||||
$toc.style.marginBottom = document.getElementById('post-footer').clientHeight + 'px';
|
||||
const $tocLinkElements = $tocCore.querySelectorAll('a:first-child');
|
||||
const $tocLiElements = $tocCore.getElementsByTagName('li');
|
||||
const $headerLinkElements = document.getElementsByClassName('header-link');
|
||||
@@ -525,6 +522,11 @@ class Theme {
|
||||
this._tocOnScroll =
|
||||
this._tocOnScroll ||
|
||||
(() => {
|
||||
const $comments = document.getElementById('comments');
|
||||
if ($comments) {
|
||||
$toc.style.marginBottom =
|
||||
document.getElementById('post-footer').clientHeight + $comments.clientHeight + 'px';
|
||||
}
|
||||
this.util.forEach($tocLinkElements, ($tocLink) => {
|
||||
$tocLink.classList.remove('active');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user