From 6f8663f7efdd8a5a8dbb5de5a03de9a1a1c1f33e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Chili=C5=84ski?= Date: Sat, 25 Apr 2020 00:44:28 +0200 Subject: [PATCH 1/5] enhancement: elastic skin: allow to drag & drop addresses between address input fields during compose message --- skins/elastic/ui.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js index 71439aeb1..83a470620 100644 --- a/skins/elastic/ui.js +++ b/skins/elastic/ui.js @@ -235,6 +235,20 @@ 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, + stop: function(event, ui) { + ui.item.parent().find('li:not(.recipient)').appendTo(ui.item.parent()); + ui.item.parent().find('input').trigger($.Event('keydown', { key: "," })); + } + }); + }); + // Image upload widget $('.image-upload').each(function() { image_upload_input(this); }); From aae1189dbfb8fcff62262a4c72957112ca2a1ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Chili=C5=84ski?= Date: Sat, 25 Apr 2020 01:07:35 +0200 Subject: [PATCH 2/5] enhancement: elastic skin: allow to drag & drop addresses between address input fields during compose message (update source list address input field to) --- skins/elastic/ui.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js index 83a470620..2b9481856 100644 --- a/skins/elastic/ui.js +++ b/skins/elastic/ui.js @@ -242,9 +242,12 @@ function rcube_elastic_ui() items: "> li.recipient", handle: false, connectWith: recipient_inputs, - stop: function(event, ui) { + 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: "," })); + } } }); }); From 682cea5cc53099319bd68d6c16c834184f31a740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Chili=C5=84ski?= Date: Sat, 25 Apr 2020 09:13:10 +0200 Subject: [PATCH 3/5] enhancement: elastic skin: allow to drag & drop addresses between address input fields during compose message (code simplification) --- skins/elastic/ui.js | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js index 2b9481856..45170c7cb 100644 --- a/skins/elastic/ui.js +++ b/skins/elastic/ui.js @@ -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($('
  • ').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 From 8db9b8b6e2500a4d674f6f3522fce3f64fbf0ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Chili=C5=84ski?= Date: Sat, 25 Apr 2020 09:20:30 +0200 Subject: [PATCH 4/5] enhancement: elastic skin: allow to drag & drop addresses between address input fields during compose message (code simplification) --- skins/elastic/ui.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js index 45170c7cb..0e33832de 100644 --- a/skins/elastic/ui.js +++ b/skins/elastic/ui.js @@ -3258,8 +3258,8 @@ function rcube_elastic_ui() 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: "," })); + input.parent().appendTo(list); + input.trigger($.Event('keydown', { key: "," })); if (ui.sender) { ui.sender.find('input').trigger($.Event('keydown', { key: "," })); } From 0b09b24a554903a925878da27cc968d690c9b790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Chili=C5=84ski?= Date: Sun, 26 Apr 2020 19:46:54 +0200 Subject: [PATCH 5/5] enhancement: elastic skin: allow to drag & drop addresses between address input fields during compose message (code simplification) --- skins/elastic/ui.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js index 0e33832de..ed830b089 100644 --- a/skins/elastic/ui.js +++ b/skins/elastic/ui.js @@ -3259,9 +3259,9 @@ function rcube_elastic_ui() connectWith: '.recipient-input', receive: function(event, ui) { input.parent().appendTo(list); - input.trigger($.Event('keydown', { key: "," })); + apply_func(); if (ui.sender) { - ui.sender.find('input').trigger($.Event('keydown', { key: "," })); + ui.sender.find('input').change(); } } });