Welcome to mirror list, hosted at ThFree Co, Russian Federation.

comments.js « js « assets - github.com/reuixiy/hugo-theme-meme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e8ba96ead8c72954029bf0a6e856237455a4a0ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
window.addEventListener("DOMContentLoaded", event => {
    {{ if .Site.Params.autoLoadComments }}
        if (typeof loadComments === 'function') {
            loadComments()
        }
    {{ else }}
        const commentsToggle = document.getElementById('load-comments');

        if (commentsToggle !== null) {
            commentsToggle.addEventListener('click', function () {
                loadComments();
                this.style = "display: none";
            });
        }
    {{  end }}
}, {once: true});