解决页脚友联bug

This commit is contained in:
1152958806@qq.com 2023-08-31 22:32:41 +08:00
parent 7767c5ee5d
commit 2f543a8e35
3 changed files with 24 additions and 26 deletions

View File

@ -70,6 +70,10 @@ var heo = {
const linksUrl = GLOBAL_CONFIG.source.links.linksUrl
const links = GLOBAL_CONFIG.source.links.linksData
const num = GLOBAL_CONFIG.source.links.linksNum
console.log()
if(links){
}
var randomFriendLinks = getArrayItems(links, num);
var htmlText = '';
for (let i = 0; i < randomFriendLinks.length; ++i) {
@ -77,7 +81,9 @@ var heo = {
htmlText += `<a class='footer-item' href='${item.spec.url}' target="_blank" rel="noopener nofollow">${item.spec.displayName}</a>`;
}
htmlText += `<a class='footer-item' href='${linksUrl}'>更多</a>`
if(document.getElementById("friend-links-in-footer")){
document.getElementById("friend-links-in-footer").innerHTML = htmlText;
}
},
//禁止图片右键单击

View File

@ -660,6 +660,7 @@ function initBlog() {
heo.stopImgRightDrag(),
heo.onlyHome(),
heo.addNavBackgroundInit(),
heo.reflashEssayWaterFall(),
heo.darkModeStatus(),
heo.initThemeColor(),
//隐藏加载动画
@ -861,11 +862,3 @@ document.addEventListener('pjax:send', function () {
})
document.addEventListener('DOMContentLoaded', function () {
//页脚友联
if(GLOBAL_CONFIG.isFriendLinksInFooter){
heo.addFriendLinksInFooter()
}
heo.reflashEssayWaterFall()
})

View File

@ -62,7 +62,6 @@
</section>
<!-- 分页还没写 -->
</div>
<script>heo.reflashEssayWaterFall();</script>
<hr/>
<!--/* 评论组件 */-->
<th:block