Переглянути джерело

Change message of comments accordion when it is toggled

Close #7
Talha Mansoor 11 роки тому
батько
коміт
bf0b51c087
1 змінених файлів з 14 додано та 0 видалено
  1. 14 0
      templates/disqus_scripts.html

+ 14 - 0
templates/disqus_scripts.html

@@ -22,6 +22,20 @@ window.onhashchange=function(){
         window.location.reload(true);
         window.location.reload(true);
 }
 }
 </script>
 </script>
+<script>
+$('#disqus_thread').on('shown', function () {
+    var link = document.getElementsByClassName('accordion-toggle');
+    var old_innerHTML = link[0].innerHTML;
+    $(link[0]).fadeOut(500, function() {
+        $(this).text('Click here to hide comments').fadeIn(500);
+    });
+    $('#disqus_thread').on('hidden', function () {
+        $(link[0]).fadeOut(500, function() {
+            $(this).text(old_innerHTML).fadeIn(500);
+        });
+    })
+})
+</script>
 {% endmacro %}
 {% endmacro %}
 
 
 {% macro disqus_comments_script(article) %}
 {% macro disqus_comments_script(article) %}