mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-17 18:22:33 +00:00
Fix disqus comment count display with PJAX enabled
This commit is contained in:
parent
1f02e81b70
commit
29de93d8d7
@ -25,7 +25,7 @@
|
|||||||
// ==================================================
|
// ==================================================
|
||||||
// Post blocks.
|
// Post blocks.
|
||||||
.main-inner {
|
.main-inner {
|
||||||
.sub-menu, .post-block, .tabs-comment, :not(.tab-pane) > .comments, .pagination {
|
.sub-menu, .post-block, .tabs-comment, & > .comments, .comment-position .comments, .pagination {
|
||||||
gemini-block();
|
gemini-block();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,7 +35,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabs-comment, :not(.tab-pane) > .comments, .pagination {
|
.tabs-comment, & > .comments, .comment-position .comments, .pagination {
|
||||||
gemini-block-not-first();
|
gemini-block-not-first();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
12
source/js/third-party/comments/disqus.js
vendored
12
source/js/third-party/comments/disqus.js
vendored
@ -3,14 +3,14 @@
|
|||||||
document.addEventListener('page:loaded', () => {
|
document.addEventListener('page:loaded', () => {
|
||||||
|
|
||||||
if (CONFIG.disqus.count) {
|
if (CONFIG.disqus.count) {
|
||||||
const loadCount = () => {
|
if (window.DISQUSWIDGETS) {
|
||||||
|
window.DISQUSWIDGETS.getCount({ reset: true });
|
||||||
|
} else {
|
||||||
|
// Defer loading until the whole page loading is completed
|
||||||
NexT.utils.getScript(`https://${CONFIG.disqus.shortname}.disqus.com/count.js`, {
|
NexT.utils.getScript(`https://${CONFIG.disqus.shortname}.disqus.com/count.js`, {
|
||||||
attributes: { id: 'dsq-count-scr' }
|
attributes: { id: 'dsq-count-scr', defer: true }
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
// defer loading until the whole page loading is completed
|
|
||||||
window.addEventListener('load', loadCount, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CONFIG.page.comments) {
|
if (CONFIG.page.comments) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user