From 32d3ec6c059bc4fbb9ab7cc49dfe926bdaadf482 Mon Sep 17 00:00:00 2001 From: Giovane Date: Fri, 18 Sep 2015 11:05:35 -0300 Subject: #442 Add feedback message to send feedback event. --- web-ui/app/js/mail_view/ui/feedback_box.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'web-ui/app/js/mail_view') diff --git a/web-ui/app/js/mail_view/ui/feedback_box.js b/web-ui/app/js/mail_view/ui/feedback_box.js index 5a04e291..f6994554 100644 --- a/web-ui/app/js/mail_view/ui/feedback_box.js +++ b/web-ui/app/js/mail_view/ui/feedback_box.js @@ -23,6 +23,7 @@ define(['flight/lib/component', 'views/templates', 'page/events', 'features'], this.defaultAttrs({ 'closeButton': '.close-mail-button', 'submitButton': '#send-button', + 'textBox': '#text-box', }); this.render = function () { @@ -40,17 +41,18 @@ define(['flight/lib/component', 'views/templates', 'page/events', 'features'], this.trigger(document, events.dispatchers.rightPane.openNoMessageSelected); }; - this.showFeedbackSubmittedMessage = function() { - this.trigger(document, events.ui.userAlerts.displayMessage, { message: 'Thanks for your feedback!' }); - }; + this.submitFeedback = function () { + var feedback = this.select('textBox').val(); + this.trigger(document, events.feedback.submit, { feedback: feedback}); + } this.after('initialize', function () { if (features.isEnabled('feedback')) { this.render(); this.on(document, events.dispatchers.rightPane.openFeedbackBox, this.openFeedbackBox); + this.on(document, events.feedback.submitted, this.showNoMessageSelected); this.on(this.select('closeButton'), 'click', this.showNoMessageSelected); - this.on(this.select('submitButton'), 'click', this.showNoMessageSelected); - this.on(this.select('submitButton'), 'click', this.showFeedbackSubmittedMessage); + this.on(this.select('submitButton'), 'click', this.submitFeedback); } }); -- cgit v1.2.3