diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2024-11-16 23:27:12 +0100 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2024-11-16 23:27:12 +0100 |
commit | f123729ed492f70de3db35c042874e5750bbea72 (patch) | |
tree | 6f303cd679992c4812b6ab6dae0fb4b950b68177 /src/jwebmail/static | |
parent | 84d7234b661a161e198206bba45cbe077c9da33e (diff) |
properly implement move and remove
added add_folder method to jwebmail api
Diffstat (limited to 'src/jwebmail/static')
-rw-r--r-- | src/jwebmail/static/src/dh-move-submit.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/jwebmail/static/src/dh-move-submit.js b/src/jwebmail/static/src/dh-move-submit.js new file mode 100644 index 0000000..cf16f9c --- /dev/null +++ b/src/jwebmail/static/src/dh-move-submit.js @@ -0,0 +1,19 @@ +function add_mail_ids(form_id) { + const chkbox = document.getElementsByClassName("jwm-mail-checkbox"); + const move_form = document.getElementById(form_id); + + for (const m of chkbox) { + if (m.checked) { + let inp = document.createElement("input"); + inp.setAttribute("type", "hidden"); + inp.setAttribute("name", "mail"); + inp.setAttribute("value", m.name); + move_form.append(inp); + } + } +} + +document.addEventListener("DOMContentLoaded", function() { + document.getElementById("move").addEventListener("click", () => add_mail_ids("move-mail")); + document.getElementById("remove").addEventListener("click", () => add_mail_ids("remove-mail")); +}); |