diff options
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 | 36 |
1 files changed, 36 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 new file mode 100644 index 00000000..967ff61b --- /dev/null +++ b/web-ui/app/js/mail_view/ui/recipients/recipient.js @@ -0,0 +1,36 @@ +'use strict'; + +define( + [ + 'flight/lib/component', + 'views/templates' + ], + + function (defineComponent, templates) { + + return defineComponent(recipient); + + function recipient() { + this.renderAndPrepend = function (nodeToPrependTo, recipient) { + var html = $(templates.compose.fixedRecipient(recipient)); + html.insertBefore(nodeToPrependTo.children().last()); + var component = new this.constructor(); + component.initialize(html, recipient); + return component; + }; + + this.destroy = function () { + this.$node.remove(); + this.teardown(); + }; + + this.select = function () { + this.$node.find('.recipient-value').addClass('selected'); + }; + + this.unselect = function () { + this.$node.find('.recipient-value').removeClass('selected'); + }; + } + } +); |