summaryrefslogtreecommitdiff
path: root/web-ui/app/js/mail_view/ui/recipients/recipients.js
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui/app/js/mail_view/ui/recipients/recipients.js')
-rw-r--r--web-ui/app/js/mail_view/ui/recipients/recipients.js25
1 files changed, 23 insertions, 2 deletions
diff --git a/web-ui/app/js/mail_view/ui/recipients/recipients.js b/web-ui/app/js/mail_view/ui/recipients/recipients.js
index 7072c09e..3dfd6661 100644
--- a/web-ui/app/js/mail_view/ui/recipients/recipients.js
+++ b/web-ui/app/js/mail_view/ui/recipients/recipients.js
@@ -46,11 +46,31 @@ define(
this.addressesUpdated();
}
- function editCurrentRecipient() {
- this.attr.iterator.editCurrent();
+ function editCurrentRecipient(event, recipient) {
+ var mailAddr = this.attr.iterator.current().getMailAddress();
+ this.attr.iterator.deleteCurrent();
+ this.attr.input.$node.val(mailAddr).focus();
+ this.unselectAllRecipients();
this.addressesUpdated();
}
+ this.clickToEditRecipient = function(event, recipient) {
+ this.attr.iterator = null;
+ var mailAddr = recipient.getMailAddress();
+
+ var position = recipient.$node.closest('.recipients-area').find('.fixed-recipient').index(recipient.$node);
+ this.attr.recipients.splice(position, 1);
+ recipient.destroy();
+
+ this.addressesUpdated();
+ this.unselectAllRecipients();
+ this.attr.input.$node.val(mailAddr).focus();
+ };
+
+ this.unselectAllRecipients = function() {
+ this.$node.find('.recipient-value.selected').removeClass('selected');
+ }
+
var SPECIAL_KEYS_ACTIONS = {
8: deleteCurrentRecipient,
46: deleteCurrentRecipient,
@@ -156,6 +176,7 @@ define(
this.on(events.ui.recipients.selectLast, this.selectLastRecipient);
this.on(events.ui.recipients.entered, this.recipientEntered);
this.on(events.ui.recipients.enteredInvalid, this.invalidRecipientEntered);
+ this.on(events.ui.recipients.clickToEdit, this.clickToEditRecipient);
this.on(document, events.ui.recipients.doCompleteInput, this.doCompleteRecipients);