diff default/blog/articles.html @ 43:f8798d691acf

blog/articles: fixed comments transition: - as for blog articles, removed max-height workaround in favor of clicked_mh_fix function - changed show to hide in button when comments are expanded - reduced transition time
author Goffi <goffi@goffi.org>
date Thu, 13 Jul 2017 08:41:07 +0200
parents f371bc50ea45
children f19e9f5e43b0
line wrap: on
line diff
--- a/default/blog/articles.html	Thu Jul 13 08:39:23 2017 +0200
+++ b/default/blog/articles.html	Thu Jul 13 08:41:07 2017 +0200
@@ -11,7 +11,11 @@
 
         {# we recursively display comments for all comments nodes (usually there's only one) #}
         {% for comments_items in item.comments_items_list %}
-            <button class="comments_btn" onclick="document.getElementById('{{comments_panel|next_gidx}}').classList.toggle('show')">{% trans %}show comments{% endtrans %} ({{comments_items|count}})</button>
+            <button class="comments_btn" onclick="clicked_mh_fix('{{comments_panel|next_gidx}}');clicked_cls(this)">
+                <span class='show'>{% trans %}show comments{% endtrans %}</span>
+                <span class='hide'>{% trans %}hide comments{% endtrans %}</span>
+                ({{comments_items|count}})
+            </button>
             <div id="{{comments_panel|cur_gidx}}" class="comments_panel">
                 {% if allow_commenting %}
                     <div class="comment_post">