From 7d517e1a7d2b8e67c10a1185aaffe939cc01b169 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Tue, 26 Sep 2023 01:11:39 -0500 Subject: [PATCH] Render mathjax when loading more comments --- resources/common.js | 4 +++- templates/comments/list.html | 2 +- templates/comments/media-js.html | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/common.js b/resources/common.js index d9c7d1e..d34e259 100644 --- a/resources/common.js +++ b/resources/common.js @@ -386,9 +386,11 @@ function onWindowReady() { }); }); $('a').click(function() { - if ($(this).attr('href') === '#') { + var href = $(this).attr('href'); + if (href === '#' || href.startsWith("javascript")) { return; } + $("#loading-bar").show(); $("#loading-bar").animate({ width: "100%" }, 2000, function() { $(this).hide().css({ width: 0}); diff --git a/templates/comments/list.html b/templates/comments/list.html index d561210..fc0df78 100644 --- a/templates/comments/list.html +++ b/templates/comments/list.html @@ -3,7 +3,7 @@

{{ _('Comments') }} {% if can_comment %} - {{ _('Write comment') }} + {{ _('Write comment') }} {% endif %}

{% if can_comment %} diff --git a/templates/comments/media-js.html b/templates/comments/media-js.html index ccae804..608385c 100644 --- a/templates/comments/media-js.html +++ b/templates/comments/media-js.html @@ -186,6 +186,7 @@ var $comment = $("#comment-" + id + "-children"); $comment.append(data); } + MathJax.typeset($('#comments')[0]); } }) }