fix(home): 修复当点击目录右侧标题后查看图片大图,会回到上次所点击的标题位置的 BUG。

fix #221
This commit is contained in:
LIlGG 2022-04-05 16:35:54 +08:00
parent 0424371e4b
commit 725bc90611
2 changed files with 9 additions and 5 deletions

View File

@ -306,8 +306,8 @@ var LIlGGAttachContext = {
headingSelector: "h1, h2, h3, h4, h5", headingSelector: "h1, h2, h3, h4, h5",
collapseDepth: !!PageAttr.metas.tocDepth && [0,1,2,3,4,5].includes(Number(PageAttr.metas.tocDepth)) ? Number(PageAttr.metas.tocDepth) : Poi.tocDepth, collapseDepth: !!PageAttr.metas.tocDepth && [0,1,2,3,4,5].includes(Number(PageAttr.metas.tocDepth)) ? Number(PageAttr.metas.tocDepth) : Poi.tocDepth,
hasInnerContainers: false, hasInnerContainers: false,
headingsOffset: disableTocScrollSync: true,
$("#page").find(".pattern-center").length > 0 ? -500 : -230, headingsOffset: $("#page").find(".pattern-center").length > 0 ? -500 : -230,
scrollEndCallback: function (e) { scrollEndCallback: function (e) {
if ($(".is-active-link").length == 0) { if ($(".is-active-link").length == 0) {
return; return;
@ -1162,7 +1162,6 @@ var home = location.href,
} }
}); });
} }
// 标签云 // 标签云
if ( if (
$("#tag-wordcloud").length > 0 && $("#tag-wordcloud").length > 0 &&
@ -1583,10 +1582,15 @@ if (
) { ) {
window.addEventListener( window.addEventListener(
"hashchange", "hashchange",
function () { function (e) {
var id = location.hash.substring(1), var id = location.hash.substring(1),
element; element;
// fix #221 图库展示结束后禁止重新跳转
if (e.oldURL.indexOf('#gallery-') !== -1) {
return;
}
if (!/^[A-z0-9_-]+$/.test(id)) { if (!/^[A-z0-9_-]+$/.test(id)) {
return; return;
} }

2
script/app.min.js vendored

File diff suppressed because one or more lines are too long