diff options
author | Jefferson Stachelski <jstachel@thoughtworks.com> | 2015-10-28 17:19:54 -0200 |
---|---|---|
committer | Jefferson Stachelski <jstachel@thoughtworks.com> | 2015-10-28 17:21:51 -0200 |
commit | 2199e5ec5f81ddbfe5eaa0ae17443dc2864783f9 (patch) | |
tree | fee03360e6efb984687171844763e68e60fdeb93 /web-ui/app/js/mail_view/ui/recipients/recipient.js | |
parent | 9068cf5c52c589c9228cca7d2ebb1ecec9129a0d (diff) |
Issue #493 - Fixed some bug and did some refactors
Fixed the nagivation mode when used click to edit recipients and also
refactored the code to split the responsability
Diffstat (limited to 'web-ui/app/js/mail_view/ui/recipients/recipient.js')
-rw-r--r-- | web-ui/app/js/mail_view/ui/recipients/recipient.js | 16 |
1 files changed, 8 insertions, 8 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 2985a9ab..66577f51 100644 --- a/web-ui/app/js/mail_view/ui/recipients/recipient.js +++ b/web-ui/app/js/mail_view/ui/recipients/recipient.js @@ -89,18 +89,18 @@ define( }.bind(this)); }; - this.editRecipient = function(evt) { - var mailAddr = this.$node.find('input[type=hidden]').val(); - // TODO: refactor the code bellow - $('#recipients-to-area').find('input.tt-input').val(mailAddr); - $('#recipients-to-area').find('input.tt-input').focus(); - this.destroy(); - // TODO: fix the bug when edit recipient and click out of the input + this.getMailAddress = function() { + return this.$node.find('input[type=hidden]').val(); }; + this.triggerEditRecipient = function(event, element) { + this.trigger(this.$node.closest('.recipients-area'), events.ui.recipients.clickToEdit, this); + } + this.after('initialize', function () { this.recipientDelActions(); - this.on('click', this.editRecipient); + this.on('click', this.triggerEditRecipient); + if (this.attr.invalidAddress){ this.sinalizeInvalid(); } else { |