From c8de9b89c47815aaaab9141c25aa18a73e4b44a9 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 21 Nov 2023 17:52:41 -0500 Subject: [PATCH] Only attempt to insert quote when replying to mail. Also do that after rendering the attachments window. Doing it before doesn't work. I don't know why. --- webcit-ng/static/js/view_mail.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/webcit-ng/static/js/view_mail.js b/webcit-ng/static/js/view_mail.js index d058f470e..830768a50 100644 --- a/webcit-ng/static/js/view_mail.js +++ b/webcit-ng/static/js/view_mail.js @@ -502,8 +502,9 @@ function mail_compose(is_quoted, references, quoted_msgnum, m_to, m_cc, m_subjec + "
" ; + // If this is a quoted reply, insert a div within which we will render the original message. if (is_quoted) { - compose_screen += "

"; + compose_screen += "

QUOTED MESSAGE HERE
"; } // The button bar is a Grid element, and is also a Flexbox container. @@ -518,14 +519,21 @@ function mail_compose(is_quoted, references, quoted_msgnum, m_to, m_cc, m_subjec
` ; + document.getElementById("ctdl-main").innerHTML = compose_screen; - mail_display_message(quoted_msgnum, document.getElementById(quoted_div_name), 0); + if (m_cc) { document.getElementById("ctdl-compose-cc-label").style.display = "block"; document.getElementById("ctdl-compose-cc-field").style.display = "block"; } activate_uploads("ctdl-editor-body"); + + // If this is a quoted reply, render the original message into the div we set up earlier. + if (is_quoted) { + document.getElementById(quoted_div_name).innerHTML = quoted_msgnum; + mail_display_message(quoted_msgnum, document.getElementById(quoted_div_name), 0); + } } // Called when the user clicks the button to make the hidden "CC" and "BCC" lines appear. -- 2.30.2