mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-16 00:49:40 +08:00
fix(comment): 修复开启评论侧边栏时报错
This commit is contained in:
parent
00aaeb871a
commit
9aae30eca2
@ -408,11 +408,11 @@ const commonContext = {
|
||||
if (!window.CommentWidget) {
|
||||
return
|
||||
}
|
||||
$('.widget-comment').each(function (index, item) {
|
||||
$('.comment-section').each(function (index, item) {
|
||||
let target = $(this).attr('data-target')
|
||||
let id = $(this).attr('data-id')
|
||||
CommentWidget.init(
|
||||
`.widget-comment[data-id='${id}'][data-target='${target}']`,
|
||||
`.comment-section[data-id='${id}'][data-target='${target}']`,
|
||||
'/plugins/PluginCommentWidget/assets/static/style.css',
|
||||
{
|
||||
group: target === 'Moment' ? 'moment.halo.run' : 'content.halo.run',
|
||||
|
@ -48,7 +48,7 @@
|
||||
</div>
|
||||
<div class="card card-content" id="comment-wrapper" th:if="${enableComment}">
|
||||
<h3 class="comment-title">评论</h3>
|
||||
<div class="widget-comment" th:data-id="${theme.config.page_config.link_comment_id}" data-target="SinglePage"></div>
|
||||
<div class="comment-section" th:data-id="${theme.config.page_config.link_comment_id}" data-target="SinglePage"></div>
|
||||
</div>
|
||||
</th:block>
|
||||
</th:block>
|
@ -91,6 +91,6 @@
|
||||
|
||||
<div class="card card-content" id="comment-wrapper" th:if="${enableComment}">
|
||||
<h3 class="comment-title">评论</h3>
|
||||
<div class="widget-comment" th:data-id="${post.metadata.name}" th:data-target="${type}"></div>
|
||||
<div class="comment-section" th:data-id="${post.metadata.name}" th:data-target="${type}"></div>
|
||||
</div>
|
||||
</th:block>
|
@ -38,7 +38,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="journal-comment" th:if="${enableComment}">
|
||||
<div class="widget-comment" data-target="Moment" th:data-id="${moment.metadata.name}"></div>
|
||||
<div class="comment-section" data-target="Moment" th:data-id="${moment.metadata.name}"></div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:replace="~{main/pagination :: pagination (${moments}, '/moments')}"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user