enhancement: elastic skin: allow to drag & drop addresses between address input fields during compose message (code simplification)

pull/7345/head
Tomasz Chiliński 4 years ago
parent aae1189dbf
commit 682cea5cc5
No known key found for this signature in database
GPG Key ID: 6792320218DC84E9

@ -235,23 +235,6 @@ function rcube_elastic_ui()
// This have to be after mail compose feature above
$('[data-recipient-input]').each(function() { recipient_input(this); });
var recipient_inputs = $('#_to, #_cc, #_bcc, #_replyto, #_followupto', $('.compose-headers')).siblings('.recipient-input');
recipient_inputs.each(function() {
$(this).sortable({
appendTo: document.body,
items: "> li.recipient",
handle: false,
connectWith: recipient_inputs,
receive: function(event, ui) {
ui.item.parent().find('li:not(.recipient)').appendTo(ui.item.parent());
ui.item.parent().find('input').trigger($.Event('keydown', { key: "," }));
if (ui.sender) {
ui.sender.find('input').trigger($.Event('keydown', { key: "," }));
}
}
});
});
// Image upload widget
$('.image-upload').each(function() { image_upload_input(this); });
@ -3269,7 +3252,19 @@ function rcube_elastic_ui()
.append($('<li>').append(input))
// "selection" hack to allow text selection in the recipient box or multiple boxes (#7129)
.on('mouseup', function () { selection = window.getSelection().toString(); })
.on('click', function() { if (!selection.length) input.focus(); });
.on('click', function() { if (!selection.length) input.focus(); })
.sortable({
appendTo: document.body,
items: "> .recipient",
connectWith: '.recipient-input',
receive: function(event, ui) {
list.find('li:not(.recipient)').appendTo(ui.item.parent());
list.find('input').trigger($.Event('keydown', { key: "," }));
if (ui.sender) {
ui.sender.find('input').trigger($.Event('keydown', { key: "," }));
}
}
});
// Hide the original input/textarea
// Note: we do not remove the original element, and we do not use

Loading…
Cancel
Save