mirror of
https://github.com/mjl-/mox.git
synced 2025-01-14 01:06:27 +03:00
webmail: dragging works on selected items, so tell user they cannot drag if they try to drag a non-selected message
This commit is contained in:
parent
20f11409b6
commit
f87f286b80
2 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue