summaryrefslogtreecommitdiffstats
path: root/assets/js
diff options
context:
space:
mode:
authoramzrk22020-06-04 18:10:44 +0800
committeramzrk22020-06-04 18:10:44 +0800
commit8e1c40916aa880388fbac104641f3e7c84335847 (patch)
tree184458bb72cc57497265cca722a6f03d514b4fc3 /assets/js
parent71c55c745781d27973526587b7124e0f292bf649 (diff)
downloadhugo-theme-fuji-8e1c40916aa880388fbac104641f3e7c84335847.tar.gz
hugo-theme-fuji-8e1c40916aa880388fbac104641f3e7c84335847.tar.bz2
hugo-theme-fuji-8e1c40916aa880388fbac104641f3e7c84335847.zip
Update metadata & fix comment checker
Diffstat (limited to 'assets/js')
-rw-r--r--assets/js/fuji.js22
1 files changed, 12 insertions, 10 deletions
diff --git a/assets/js/fuji.js b/assets/js/fuji.js
index fbd0359..4bc9d56 100644
--- a/assets/js/fuji.js
+++ b/assets/js/fuji.js
@@ -98,17 +98,19 @@ document.querySelector('.btn .btn-toggle-mode').addEventListener('click', () =>
// update medium background
updateMeidumTheme(mediumInst);
// switch comment area theme
- // only works after comment area are initialized
+ // if this page has comment area
let commentArea = document.querySelector('.post-comment');
- let commentStatus = document.querySelector('span.post-comment-notloaded').getAttribute('style');
- if (commentStatus) {
- if (commentArea.getAttribute('data-comment') === 'utterances') {
- updateUtterancesTheme(document.querySelector('.post-comment iframe'));
- }
- if (commentArea.getAttribute('data-comment') === 'disqus') {
- DISQUS.reset({
- reload: true,
- });
+ if (commentArea) {
+ // if comment area loaded
+ if (document.querySelector('span.post-comment-notloaded').getAttribute('style')) {
+ if (commentArea.getAttribute('data-comment') === 'utterances') {
+ updateUtterancesTheme(document.querySelector('.post-comment iframe'));
+ }
+ if (commentArea.getAttribute('data-comment') === 'disqus') {
+ DISQUS.reset({
+ reload: true,
+ });
+ }
}
}
});