From a5f6d32977c5b2d27d5e36fa7d512a6952f1fc7b Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Fri, 23 Dec 2022 02:20:53 -0600 Subject: [PATCH] Fix comment edit --- judge/views/comment.py | 5 ++++- templates/comments/media-js.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/judge/views/comment.py b/judge/views/comment.py index 20d1d5b..962d9f1 100644 --- a/judge/views/comment.py +++ b/judge/views/comment.py @@ -136,7 +136,10 @@ class CommentEditForm(ModelForm): fields = ["body"] widgets = { "body": HeavyPreviewPageDownWidget( - id="id-edit-comment-body", preview=reverse_lazy("comment_preview") + id="id-edit-comment-body", + preview=reverse_lazy("comment_preview"), + preview_timeout=1000, + hide_preview_button=True, ), } diff --git a/templates/comments/media-js.html b/templates/comments/media-js.html index 968ec16..e1c1ec1 100644 --- a/templates/comments/media-js.html +++ b/templates/comments/media-js.html @@ -167,7 +167,7 @@ afterOpen: function () { register_dmmd_preview($('#id-edit-comment-body-preview')); if ('DjangoPagedown' in window) { - var $wmd = $('.featherlight .wmd-input'); + var $wmd = $('.featherlight .wmd-wrapper'); if ($wmd.length) { window.DjangoPagedown.createEditor($wmd.get(0)); if ('MathJax' in window) {