From: Art Cancro Date: Mon, 13 Mar 2023 17:50:57 +0000 (-0400) Subject: Activate mouse-up events on rooms in the mail folder list. X-Git-Tag: v976~72 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=5c92deb729132df0896ed13cc9a533fb90fb39cf;p=citadel.git Activate mouse-up events on rooms in the mail folder list. This will be used for drag-and-drop. --- diff --git a/webcit-ng/static/js/mail_folder_list.js b/webcit-ng/static/js/mail_folder_list.js index c4c18e65d..54db61d6a 100644 --- a/webcit-ng/static/js/mail_folder_list.js +++ b/webcit-ng/static/js/mail_folder_list.js @@ -1,6 +1,6 @@ // Display the mail folder list // -// Copyright (c) 2016-2022 by the citadel.org team +// Copyright (c) 2016-2023 by the citadel.org team // // This program is open source software. Use, duplication, or // disclosure are subject to the GNU General Public License v3. @@ -50,9 +50,12 @@ function render_mail_folder_list(roomlist_json) { rendered_list += ""; @@ -60,3 +63,15 @@ function render_mail_folder_list(roomlist_json) { return rendered_list; } + + +// The user released the mouse button over a folder name -- this is probably a drop event +function mail_mouseup(roomname) { + console.log("mail_mouseup " + roomname); + + // todo: + // 1. First check to see if a drag operation is in progress. Exit if there is no such case. + // 2. Perform the MOVE operation on the selected rows. + +} + diff --git a/webcit-ng/static/js/view_mail.js b/webcit-ng/static/js/view_mail.js index d5b13141b..43c930aa8 100644 --- a/webcit-ng/static/js/view_mail.js +++ b/webcit-ng/static/js/view_mail.js @@ -17,7 +17,7 @@ var newmail_notify = { // This is the async back end for mail_delete_selected() mail_delete_func = async(table, row) => { - let m = parseInt(row["id"].substring(12)); // derive msgnum from row id + let m = parseInt(row["id"].substring(12)); // derive msgnum from row id if (is_trash_folder) { response = await fetch( @@ -37,7 +37,7 @@ mail_delete_func = async(table, row) => { ); } - if (response.ok) { // If the server accepted the delete, blank out the message div. + if (response.ok) { // If the server accepted the delete, blank out the message div table.deleteRow(row.rowIndex); if (m == displayed_message) { document.getElementById("ctdl-mailbox-reading-pane").innerHTML = ""; diff --git a/webcit-ng/static/js/views.js b/webcit-ng/static/js/views.js index 2d65edb3b..5292050bc 100644 --- a/webcit-ng/static/js/views.js +++ b/webcit-ng/static/js/views.js @@ -1,10 +1,9 @@ -// Copyright (c) 2016-2022 by the citadel.org team +// Copyright (c) 2016-2023 by the citadel.org team // // This program is open source software. Use, duplication, or // disclosure are subject to the GNU General Public License v3. - // Clear the sidebar buttons of any style indicating that one is selected function clear_sidebar_selection() { var items = document.getElementById("ctdl-sidebar").getElementsByTagName("*");