修复最近评论错误;修复无右键菜单切换深浅色模式错误;

This commit is contained in:
sunheyi 2023-07-01 09:07:08 +08:00
parent 831dad39cf
commit b73c752142
4 changed files with 9 additions and 4 deletions

View File

@ -353,6 +353,10 @@ rm.copyLink = function () {
btf.snackbarShow('已复制链接地址'); btf.snackbarShow('已复制链接地址');
} }
function switchDarkMode(){
rm.switchDarkMode();
}
function addRightMenuClickEvent() { function addRightMenuClickEvent() {
// 添加点击事件 // 添加点击事件
$('#menu-backward').on('click', function () { $('#menu-backward').on('click', function () {

View File

@ -1,8 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"> <html lang="en" xmlns:th="http://www.thymeleaf.org">
<!-- 右键菜单 --> <!-- 右键菜单 -->
<div th:fragment="right-menu" th:if="${theme.config.rightMenu.switch}"> <div th:fragment="right-menu" th:if="${theme.config.rightMenu.switch}">
<script th:src="@{/assets/zhheo/rightmenu.js}"></script>
<div id="rightMenu" > <div id="rightMenu" >
<div class="rightMenu-group rightMenu-small"> <div class="rightMenu-group rightMenu-small">
<div class="rightMenu-item" id="menu-backward"><i class="iconfont icon-arrow-left"></i></div> <div class="rightMenu-item" id="menu-backward"><i class="iconfont icon-arrow-left"></i></div>

View File

@ -5,7 +5,7 @@
<!-- 最近评论 --> <!-- 最近评论 -->
<script <script
th:fragment="cardNewestComments" th:fragment="cardNewestComments"
th:if="${theme.config.comments.twikoo && #strings.equals(theme.config.comments.use, 'Twikoo') && not #strings.isEmpty(theme.config.comments.envId)}"> th:if="${theme.config.comments.twikoo && #strings.equals(theme.config.comments.use, 'Twikoo') && #strings.isNotEmpty(theme.config.comments.envId)}">
window.addEventListener('load', () => { window.addEventListener('load', () => {
const changeContent = (content) => { const changeContent = (content) => {
if (content === '') return content if (content === '') return content

View File

@ -68,9 +68,10 @@
</ul> </ul>
</div> </div>
<div class="button-group"> <div class="button-group">
<script th:src="@{/assets/zhheo/rightmenu.js}"></script>
<div class="console-btn-item"> <div class="console-btn-item">
<!-- 用到了 rightmenu.js 的功能,还需要调整 --> <!-- 用到了 rightmenu.js 的功能,还需要调整 -->
<a class="darkmode_switchbutton" href="javascript:void(0);" onclick="rm.switchDarkMode()" rel="external nofollow" <a class="darkmode_switchbutton" href="javascript:void(0);" onclick="switchDarkMode()" rel="external nofollow"
title="显示模式切换"><i class="iconfont icon-moon" style="font-size:1rem"></i> title="显示模式切换"><i class="iconfont icon-moon" style="font-size:1rem"></i>
</a> </a>
</div> </div>