diff --git a/webmail/webmail.js b/webmail/webmail.js index c13fc2a..707ccf2 100644 --- a/webmail/webmail.js +++ b/webmail/webmail.js @@ -2427,6 +2427,11 @@ const newMsgitemView = (mi, msglistView, otherMailbox, listMailboxes, receivedTi const active = msgitemView.root && msgitemView.root.classList.contains('active'); const focus = msgitemView.root && msgitemView.root.classList.contains('focus'); const elem = dom.div(dom._class('msgitem'), active ? dom._class('active') : [], focus ? dom._class('focus') : [], attr.draggable('true'), function dragstart(e) { + if (!msglistView.selected().includes(msgitemView)) { + e.preventDefault(); + window.alert('Can only drag items in selection.'); + return; + } // We send the Message.ID and MailboxID, so we can decide based on the destination // mailbox whether to move. We don't move messages already in the destination // mailbox, and also skip messages in the Sent mailbox when there are also messages diff --git a/webmail/webmail.ts b/webmail/webmail.ts index 540e28e..c7795f2 100644 --- a/webmail/webmail.ts +++ b/webmail/webmail.ts @@ -1835,6 +1835,11 @@ const newMsgitemView = (mi: api.MessageItem, msglistView: MsglistView, otherMail focus ? dom._class('focus') : [], attr.draggable('true'), function dragstart(e: DragEvent) { + if (!msglistView.selected().includes(msgitemView)) { + e.preventDefault() + window.alert('Can only drag items in selection.') + return + } // We send the Message.ID and MailboxID, so we can decide based on the destination // mailbox whether to move. We don't move messages already in the destination // mailbox, and also skip messages in the Sent mailbox when there are also messages