From 2199e5ec5f81ddbfe5eaa0ae17443dc2864783f9 Mon Sep 17 00:00:00 2001 From: Jefferson Stachelski Date: Wed, 28 Oct 2015 17:19:54 -0200 Subject: 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 --- web-ui/app/js/mail_view/ui/recipients/recipient.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'web-ui/app/js/mail_view/ui/recipients/recipient.js') 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 { -- cgit v1.2.3