summaryrefslogtreecommitdiff
path: root/web-ui/app/js/mail_view/ui/recipients
diff options
context:
space:
mode:
authorJefferson Stachelski <jstachel@thoughtworks.com>2015-10-23 12:09:17 -0200
committerJefferson Stachelski <jstachel@thoughtworks.com>2015-10-23 12:09:17 -0200
commit066efbfb6a4938895348adf90e910f55c91f3260 (patch)
tree744b6040fb6b271d762a1567b40b8d3304b1b3a7 /web-ui/app/js/mail_view/ui/recipients
parent6d49949a73cf4757b4f616ee9398863d8ba62988 (diff)
Issue #493 - Its possible edit the recipients
Diffstat (limited to 'web-ui/app/js/mail_view/ui/recipients')
-rw-r--r--web-ui/app/js/mail_view/ui/recipients/recipient.js10
-rw-r--r--web-ui/app/js/mail_view/ui/recipients/recipients.js7
-rw-r--r--web-ui/app/js/mail_view/ui/recipients/recipients_iterator.js4
3 files changed, 21 insertions, 0 deletions
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();
+ };
}
});