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

github.com/uPagge/uBlogger.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoruPagge <upagge@mail.ru>2021-01-06 19:58:46 +0300
committeruPagge <upagge@mail.ru>2021-01-06 19:58:46 +0300
commit3f35708561c2e7b98015df8f94aaafca581379fa (patch)
treef75dcedb6cef851e4538430c67e666c3f1636718 /src
parentc9e67ce7fd977558b13605b51f30b313110ca999 (diff)
add split and block-media-1
Diffstat (limited to 'src')
-rw-r--r--src/js/theme.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/js/theme.js b/src/js/theme.js
index d025311..84b24c5 100644
--- a/src/js/theme.js
+++ b/src/js/theme.js
@@ -391,7 +391,7 @@ class Theme {
initHeaderLink() {
for (let num = 1; num <= 6; num++) {
- this.util.forEach(document.querySelectorAll('.single .content > h' + num), $header => {
+ this.util.forEach(document.querySelectorAll('h' + num), $header => {
$header.classList.add('headerLink');
$header.insertAdjacentHTML('afterbegin', `<a href="#${$header.id}" class="header-mark"></a>`);
});
@@ -450,8 +450,7 @@ class Theme {
for (let i = 0; i < $headerLinkElements.length - 1; i++) {
const thisTop = $headerLinkElements[i].getBoundingClientRect().top;
const nextTop = $headerLinkElements[i + 1].getBoundingClientRect().top;
- if ((i == 0 && thisTop > INDEX_SPACING)
- || (thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING)) {
+ if ((i === 0 && thisTop > INDEX_SPACING) || (thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING)) {
activeTocIndex = i;
break;
}