All events are firing correctly. Ready to write the action.
authorArt Cancro <ajc@citadel.org>
Tue, 4 Jul 2023 04:19:12 +0000 (19:19 -0900)
committerArt Cancro <ajc@citadel.org>
Tue, 4 Jul 2023 04:19:12 +0000 (19:19 -0900)
webcit-ng/static/js/mail_folder_list.js

index 7571f7ca0580f42e1403658c93e33bef79baf644..6f216c418103fcca478db93ccc516c3b838f9527 100644 (file)
@@ -55,7 +55,7 @@ function render_mail_folder_list(roomlist_json) {
                                        + "ondragstart=\"mail_folder_dragstart(event)\" "
                                        + "ondragover=\"mail_folder_dragover(event)\" "
                                        + "ondragleave=\"mail_folder_dragleave(event)\" "
-                                       + "ondrop=\"mail_folder_drop(event)\" "
+                                       + "ondrop=\"mail_folder_drop(event, '" + escapeJS(roomlist_json[i].name) + "')\" "
                                        + ">"
                                        + ((roomlist_json[i].name == "Mail") ? _("INBOX") : escapeHTML(roomlist_json[i].name))
                                        + "</li>\n"
@@ -67,8 +67,10 @@ function render_mail_folder_list(roomlist_json) {
 }
 
 
+// The user has begun hovering over this folder while dragging one or more messages -- highlight it as a drop target
 function mail_folder_dragstart(event) {
        event.preventDefault();
+       // FIXME write this
 }
 
 
@@ -78,11 +80,14 @@ function mail_folder_dragover(event) {
 }
 
 
+// The user is no longer hovering over this folder -- unhighlight it
 function mail_folder_dragleave(event) {
        event.preventDefault();
+       // FIXME write this
 }
 
 
-function mail_folder_drop(event) {
-       console.log("target DROP!");
+function mail_folder_drop(event, target) {
+       event.preventDefault();
+       console.log("FIXME: complete the code for target DROP! " + target);
 }