deactivate_uploads() hides the window.
authorArt Cancro <ajc@citadel.org>
Wed, 11 Oct 2023 21:58:46 +0000 (17:58 -0400)
committerArt Cancro <ajc@citadel.org>
Wed, 11 Oct 2023 21:58:46 +0000 (17:58 -0400)
webcit-ng/static/js/upload.js
webcit-ng/static/js/view_mail.js

index 228e97aceb5f2e0b57f07f68049cfb852cc6f6a0..6dbd92e64e935fe372de20263131fb839c70e5da 100644 (file)
@@ -10,6 +10,12 @@ var uploads_in_progress = 0;
 var uploads = [] ;                                                             // everything the user has uploaded
 
 
+// Remove the upload window completely (even if it's hidden)
+function deactivate_uploads() {
+       document.getElementById("ctdl-upload").remove();
+}
+
+
 // Turn the specified div into a place where we can upload.  (Note: permanently changes the drag-and-drop behavior of that div.)
 function activate_uploads(parent_div) {
                document.getElementById(parent_div).innerHTML += `
@@ -152,4 +158,6 @@ function flush_uploads() {
                console.log(u.ref);
        });
         uploads=[];
+
+       deactivate_uploads();   // this makes the window get destroyed too
 }
index 3071496e8612ae816dc420dfa93e8152a2186e3f..e015466f249a71d94061f89fb5c457871a2a2c26 100644 (file)
@@ -525,7 +525,7 @@ function mail_compose(is_quoted, references, quoted_msgnum, m_to, m_cc, m_subjec
                document.getElementById("ctdl-compose-cc-field").style.display = "block";
        }
 
-       activate_uploads("ctdl-compose-mail");
+       activate_uploads("ctdl-editor-body");
 }
 
 // Called when the user clicks the button to make the hidden "CC" and "BCC" lines appear.
@@ -553,6 +553,7 @@ function msm_field(element_name, separator) {
 function mail_send_message() {
 
        document.body.style.cursor = "wait";
+       deactivate_uploads();
        let url = "/ctdl/r/" + escapeHTMLURI(current_room)
                + "/dummy_name_for_new_mail"
                + "?wefw="      + msm_field("ctdl_mc_references", "!")                          // references (if present)