From 066efbfb6a4938895348adf90e910f55c91f3260 Mon Sep 17 00:00:00 2001 From: Jefferson Stachelski Date: Fri, 23 Oct 2015 12:09:17 -0200 Subject: Issue #493 - Its possible edit the recipients --- web-ui/app/js/mail_view/ui/recipients/recipient.js | 10 ++++++++++ web-ui/app/js/mail_view/ui/recipients/recipients.js | 7 +++++++ web-ui/app/js/mail_view/ui/recipients/recipients_iterator.js | 4 ++++ 3 files changed, 21 insertions(+) (limited to 'web-ui') diff --git a/web-ui/app/js/mail_view/ui/recipients/recipient.js b/web-ui/app/js/mail_view/ui/recipients/recipient.js index f4e6e9a6..5b0535fb 100644 --- a/web-ui/app/js/mail_view/ui/recipients/recipient.js +++ b/web-ui/app/js/mail_view/ui/recipients/recipient.js @@ -85,9 +85,19 @@ define( }.bind(this)); }; + this.editRecipient = function(evt) { + var mailAddr = this.$node.children('input[type=hidden]').val(); + // TODO: refator the code bellow + $("#recipients-to-area").find("input.tt-input").val(mailAddr); + $("#recipients-to-area").find("input.tt-input").focus(); + // this.triger(document, events.ui.recipients:inputFieldHasCharacters); + this.destroy(); + }; + this.after('initialize', function () { this.recipientDelActions(); this.discoverEncryption(); + this.on('dblclick', this.editRecipient); }); } } 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 d9a894a6..f5d51d31 100644 --- a/web-ui/app/js/mail_view/ui/recipients/recipients.js +++ b/web-ui/app/js/mail_view/ui/recipients/recipients.js @@ -46,9 +46,16 @@ define( this.addressesUpdated(); } + function editCurrentRecipient() { + this.attr.iterator.editCurrent(); + this.addressesUpdated(); + } + var SPECIAL_KEYS_ACTIONS = { 8: deleteCurrentRecipient, 46: deleteCurrentRecipient, + 32: editCurrentRecipient, + 13: editCurrentRecipient, 37: moveLeft, 39: moveRight }; diff --git a/web-ui/app/js/mail_view/ui/recipients/recipients_iterator.js b/web-ui/app/js/mail_view/ui/recipients/recipients_iterator.js index 6c52c52e..35741bb7 100644 --- a/web-ui/app/js/mail_view/ui/recipients/recipients_iterator.js +++ b/web-ui/app/js/mail_view/ui/recipients/recipients_iterator.js @@ -54,6 +54,10 @@ define(['helpers/iterator'], function (Iterator) { this.input.focus(); } }; + + this.editCurrent = function() { + this.iterator.removeCurrent().editRecipient(); + }; } }); -- cgit v1.2.3