_includes/plugins/comments/comments_js.html in jekyll-theme-h2o-ac-1.3.6 vs _includes/plugins/comments/comments_js.html in jekyll-theme-h2o-ac-1.4.0

- old
+ new

@@ -1,24 +1,25 @@ {% include plugins/comments/disqus.html %} {% include plugins/comments/waline_js.html %} +{% include plugins/comments/artalk_js.html %} +{% include plugins/comments/giscus_js.html %} +{% include plugins/comments/twikoo_js.html %} <script> $(document).ready(function () { - if ($("#comments-switch").length > 0) { + if ($(".comment").length == 3) { var comment_status = $("#cmn-toggle-4")[0].checked; if (comment_status) { - $("#waline").addClass("active"); + $(".comment:last > div").addClass("active"); } else { - $("#disqus_thread").addClass("active"); + $(".comment:nth-last-child(2) > div").addClass("active"); } $("#cmn-toggle-4").click(function () { - $("#disqus_thread").toggleClass("active"); - $("#waline").toggleClass("active"); + $(".comment:nth-last-child(2) > div").toggleClass("active"); + $(".comment:last > div").toggleClass("active"); }) } else { - if ($("#disqus_thread").length > 0) { - $("#disqus_thread").addClass("active"); - } else if ($("#waline").length > 0) { - $("#waline").addClass("active"); + if ($(".comment").length == 2) { + $(".comment:last > div").addClass("active") } } }) </script> \ No newline at end of file