Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dillonzq/LoveIt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDillon <dillonzq@outlook.com>2020-05-12 19:45:19 +0300
committerGitHub <noreply@github.com>2020-05-12 19:45:19 +0300
commit762a7e538d291e0ede8ca4d64b2fcf12ec5d8e9c (patch)
treef06f89d019773095e90e74f06d3bf699d0e9da44 /src
parent6aa05a7f3e4ab75d4c7847d15a4af36375d1c4f0 (diff)
feat(compatibility): improve compatibility for Hugo basic version (#352)
Diffstat (limited to 'src')
-rw-r--r--src/js/theme.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/js/theme.js b/src/js/theme.js
index 4bf9c48a..0d449386 100644
--- a/src/js/theme.js
+++ b/src/js/theme.js
@@ -419,7 +419,7 @@ class Theme {
const $tocLinkElements = $tocCore.querySelectorAll('a:first-child');
const $tocLiElements = $tocCore.getElementsByTagName('li');
const $headerLinkElements = document.getElementsByClassName('headerLink');
- const headerIsFixed = this.config.headerMode.desktop !== 'normal';
+ const headerIsFixed = document.body.getAttribute('header-desktop') !== 'normal';
const headerHeight = document.getElementById('header-desktop').offsetHeight;
const TOP_SPACING = 20 + (headerIsFixed ? headerHeight : 0);
const minTocTop = $toc.offsetTop;
@@ -628,8 +628,8 @@ class Theme {
onScroll() {
const $headers = [];
- if (this.config.headerMode.desktop === 'auto') $headers.push(document.getElementById('header-desktop'));
- if (this.config.headerMode.mobile === 'auto') $headers.push(document.getElementById('header-mobile'));
+ if (document.body.getAttribute('header-desktop') === 'auto') $headers.push(document.getElementById('header-desktop'));
+ if (document.body.getAttribute('header-mobile') === 'auto') $headers.push(document.getElementById('header-mobile'));
if (document.getElementById('comments')) {
const $viewComments = document.getElementById('view-comments');
$viewComments.href = `#comments`;