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:
authorKhusika Dhamar Gusti <mail@khusika.com>2020-11-26 02:52:07 +0300
committerKhusika Dhamar Gusti <mail@khusika.com>2020-11-26 12:46:31 +0300
commit1281b131090463d917eb412866007b888140cf3b (patch)
tree5615048f440b3897f9411e98f555d0c08223e545 /src
parentfbceb4ad5df99cad6088873156d1c4c20a4fa925 (diff)
fix(header): Use data attributes for header mode
Partially fixes: #401 Signed-off-by: Khusika Dhamar Gusti <mail@khusika.com>
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 ac2c4e58..5919e0f0 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 = document.body.getAttribute('header-desktop') !== 'normal';
+ const headerIsFixed = document.body.getAttribute('data-header-desktop') !== 'normal';
const headerHeight = document.getElementById('header-desktop').offsetHeight;
const TOP_SPACING = 20 + (headerIsFixed ? headerHeight : 0);
const minTocTop = $toc.offsetTop;
@@ -632,8 +632,8 @@ class Theme {
onScroll() {
const $headers = [];
- 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.body.getAttribute('data-header-desktop') === 'auto') $headers.push(document.getElementById('header-desktop'));
+ if (document.body.getAttribute('data-header-mobile') === 'auto') $headers.push(document.getElementById('header-mobile'));
if (document.getElementById('comments')) {
const $viewComments = document.getElementById('view-comments');
$viewComments.href = `#comments`;