Skip to content

Commit

Permalink
修复当未填写社交信息时,社交信息容器闪烁后才消失的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
vaifix committed Mar 1, 2024
1 parent 8f294ed commit cb745bf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
20 changes: 20 additions & 0 deletions src/Ankia-Theme.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,25 @@
<div id="bloggerInfoName" class="bloggerInfoTitleStyle"><%= bloggerName%></div>
<div id="motto" class="bloggerInfoContentStyle"><%= subRoot.note.getLabelValue("motto") %></div>
</div>
<%
const linkLabels = [
"githubLink",
"RSSLink",
"zhihuLink",
"sspaiLink",
"netEaseCloudLink",
"bilibiliLink",
"doubanLink",
"telegramLink",
"mailLink"
];
const socialInformationExist = linkLabels.some(element => {
if (subRoot.note.hasLabel(element)){
return true;
}
});
%>
<% if (socialInformationExist) {%>
<div id="otherPlatformBar" class="bloggerInfoCardStyle">
<% if (subRoot.note.hasLabel("githubLink") && subRoot.note.getLabelValue("githubLink")!=null) { %>
<a class="platformStyle" target="_blank" rel="noopener" title="github" href="<%= subRoot.note.getLabelValue("githubLink") %>"><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
Expand Down Expand Up @@ -528,6 +547,7 @@
</a>
<% } %>
</div>
<% } %>
<div id="announcement" class="bloggerInfoCardStyle">
<div class="bloggerInfoTitleStyle">公告</div>
<hr>
Expand Down
11 changes: 0 additions & 11 deletions src/Ankia-Theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,4 @@ document.addEventListener(
});
},
false
);

document.addEventListener(
"DOMContentLoaded",
() => {
const otherPlatformBar = document.getElementById("otherPlatformBar");
if (otherPlatformBar.children.length === 0) {
otherPlatformBar.style.display = "none";
}
},
false
);
2 changes: 1 addition & 1 deletion src/Ankia-Theme.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cb745bf

Please sign in to comment.