Merge pull request #20 from mashirozx/master

update
pull/316/head
Himehane 2019-09-29 22:39:29 +08:00 committed by GitHub
commit 13112517a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 14 deletions

View File

@ -546,20 +546,10 @@ function tableOfContentScroll(flag) {
} else if ($("div").hasClass("have-toc") == false && $("div").hasClass("has-toc") == false) {
$(".toc-container").remove();
} else {
$(document).ready(function () {
if ($("div").hasClass("toc")) {
$(".toc-container").css("height", $(".site-content").outerHeight());
setTimeout(function () {
$(".toc-container").css("height", $(".site-content").outerHeight());
}, 1000);
setTimeout(function () {
$(".toc-container").css("height", $(".site-content").outerHeight());
}, 6000);
}
});
if (flag) {
var id = 1;
$(".entry-content , .links").children("h1,h2,h3,h4,h5").each(function () {
var id = 1,
heading_fix=$("div").hasClass("pattern-attachment-img") ? -75 : 200;
$(".entry-content , .links").children("h1,h2,h3,h4,h5").each(function() {
var hyphenated = "toc-head-" + id;
this.id = hyphenated;
id++;
@ -568,6 +558,7 @@ function tableOfContentScroll(flag) {
tocSelector: '.toc',
contentSelector: ['.entry-content', '.links'],
headingSelector: 'h1, h2, h3, h4, h5',
headingsOffset: heading_fix-window.innerHeight/2,
});
}
}

View File

@ -8048,7 +8048,8 @@ a.toc-link {
background: #fff;
color: #21252b
}
.hljs span::selection,
.hljs::selection ,
.hljs-ln-line span::selection,
.hljs-ln-line::selection {
background: #fff;
@ -8479,4 +8480,11 @@ td.hljs-ln-numbers {
background: #ddd;
color: black;
}
h1[id*=toc-head]::before,h2[id*=toc-head]::before,h3[id*=toc-head]::before,h4[id*=toc-head]::before,h5[id*=toc-head]::before,h6[id*=toc-head]::before {
display:block;
content:" ";
height:80px;
margin-top:-80px;
visibility:hidden
}