Merge branch 'issuse'

This commit is contained in:
zhanzhenping 2024-07-05 14:58:55 +08:00
commit 6792c825ea
2 changed files with 38 additions and 10 deletions

View File

@ -51,30 +51,43 @@
width: 100%; width: 100%;
} }
.whole-article-wrap {
display: flex;
flex-direction: column;
}
.article-body .markdown-toc{ .article-body .markdown-toc{
position: fixed; position: fixed;
right: 0; right: 50px;
width: 260px; width: 260px;
font-size: 12px; font-size: 12px;
margin-top: -70px;
overflow: auto; overflow: auto;
margin-right: 50px; border: 1px solid #e8e8e8;
border-radius: 6px;
} }
.markdown-toc ul{ .markdown-toc ul{
list-style:none; list-style:none;
} }
.markdown-toc-list {
padding:20px 0 !important;
margin-bottom: 0 !important;
}
.markdown-toc .markdown-toc-list>li{ .markdown-toc .markdown-toc-list>li{
padding: 3px 10px 3px 16px; padding: 3px 10px 3px 16px;
line-height: 18px; line-height: 18px;
border-left: 2px solid #e8e8e8; /*border-left: 2px solid #e8e8e8;*/
color: #595959; color: #595959;
margin-left: -2px;
} }
.markdown-toc .markdown-toc-list>li.active{ .markdown-toc .markdown-toc-list>li.active{
border-right: 2px solid #25b864; border-right: 2px solid #25b864;
} }
.article-body .markdown-article{ .article-body .markdown-article{
margin-right: 250px; width: calc(100% - 260px);
/*margin-right: 250px;*/
} }
.article-body.content .markdown-toc{ .article-body.content .markdown-toc{
position: relative; position: relative;
@ -87,7 +100,7 @@
.markdown-toc-list .directory-item { .markdown-toc-list .directory-item {
padding: 3px 10px 3px 16px; padding: 3px 10px 3px 16px;
line-height: 18px; line-height: 18px;
border-left: 2px solid #e8e8e8; /*border-left: 2px solid #e8e8e8;*/
color: #595959; color: #595959;
} }
.markdown-toc-list .directory-item-link { .markdown-toc-list .directory-item-link {

View File

@ -143,9 +143,7 @@ function renderPage($data) {
$("#doc_id").val($data.doc_id); $("#doc_id").val($data.doc_id);
if ($data.page) { if ($data.page) {
loadComment($data.page, $data.doc_id); loadComment($data.page, $data.doc_id);
} else {
}
else {
pageClicked(-1, $data.doc_id); pageClicked(-1, $data.doc_id);
} }
@ -156,6 +154,7 @@ function renderPage($data) {
$("#view_container").removeClass("theme__dark theme__green theme__light theme__red theme__default") $("#view_container").removeClass("theme__dark theme__green theme__light theme__red theme__default")
$("#view_container").addClass($data.markdown_theme) $("#view_container").addClass($data.markdown_theme)
} }
checkMarkdownTocElement();
} }
/*** /***
@ -230,6 +229,7 @@ function initHighlighting() {
} }
$(function () { $(function () {
checkMarkdownTocElement();
$(".view-backtop").on("click", function () { $(".view-backtop").on("click", function () {
$('.manual-right').animate({ scrollTop: '0px' }, 200); $('.manual-right').animate({ scrollTop: '0px' }, 200);
}); });
@ -280,7 +280,7 @@ $(function () {
$(window).resize(function (e) { $(window).resize(function (e) {
var h = $(".manual-catalog").innerHeight() - 20; var h = $(".manual-catalog").innerHeight() - 50;
$(".markdown-toc").height(h); $(".markdown-toc").height(h);
}).resize(); }).resize();
@ -418,3 +418,18 @@ function loadCopySnippets() {
Prism.highlightElement(snippet); Prism.highlightElement(snippet);
}); });
} }
function checkMarkdownTocElement() {
console.log(111)
let toc = $(".markdown-toc-list");
let articleComment = $("#articleComment");
if (toc.length) {
$(".wiki-bottom-left").css("width", "calc(100% - 260px)");
articleComment.css("width", "calc(100% - 260px)");
articleComment.css("margin", "30px 0 70px 0");
} else {
$(".wiki-bottom-left").css("width", "100%");
articleComment.css("width", "100%");
articleComment.css("margin", "30px auto 70px auto;");
}
}