Keep the "Attachments:" button updated.
authorArt Cancro <ajc@citadel.org>
Wed, 13 Dec 2023 02:21:19 +0000 (21:21 -0500)
committerArt Cancro <ajc@citadel.org>
Wed, 13 Dec 2023 02:21:19 +0000 (21:21 -0500)
When an attachment is added or removed using the upload window,
also update the count in the button.

webcit-ng/static/js/view_mail.js

index 98eba01c79855435da082067392cfaa5a02a2d6a..d559544b2fbc774846072e16a5adac99ad018240 100644 (file)
@@ -551,7 +551,8 @@ function mail_compose(references, quoted_msgnum, m_to, m_cc, m_subject) {
                document.getElementById("ctdl-compose-cc-field").style.display = "block";
        }
 
-       activate_uploads("ctdl-editor-body");
+       activate_uploads("ctdl-editor-body");                           // create the attachments window
+       attachment_counter_divs.push("ctdl_num_attachments");           // make the Attachments: count at the bottom update too
 
        // If this is a quoted reply, render the original message into the div we set up earlier.
        if (is_quoted) {