Skip to content
Snippets Groups Projects
Commit c7b70942 authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[IMP] im_livechat: allow to close chat without feedback

opw-658973
parent 2f19fdc3
Branches
Tags
No related merge requests found
......@@ -191,6 +191,7 @@ var Feedback = Widget.extend({
events: {
'click .o_livechat_rating_choices img': 'on_click_smiley',
'click .o_livechat_no_feedback em': 'on_click_no_feedback',
'click .o_rating_submit_button': 'on_click_send',
},
......@@ -217,6 +218,12 @@ var Feedback = Widget.extend({
this._send_feedback({close: close_chat});
},
on_click_no_feedback: function (ev) {
var content = _t("I did not rate this conversation. Bye.");
this.trigger("send_message", {content: content});
this.trigger("feedback_sent"); // will close the chat
},
on_click_send: function () {
if (_.isNumber(this.rating)) {
this._send_feedback({ reason: this.$('textarea').val(), close: true });
......
......@@ -22,6 +22,16 @@
.o_chat_window .o_chat_content .o_livechat_rating {
padding: 15px;
.o_livechat_no_feedback {
padding-top: 20px;
text-align: right;
font-size: 12px;
> em {
cursor: pointer;
}
}
.o_livechat_rating_feedback_text {
text-align: justify;
}
......
......@@ -11,6 +11,9 @@
<img t-att-src="widget.server_origin + '/rating/static/src/img/rating_10.png'" alt="Good" data-value="10"/>
<img t-att-src="widget.server_origin + '/rating/static/src/img/rating_5.png'" alt="OK" data-value="5"/>
<img t-att-src="widget.server_origin + '/rating/static/src/img/rating_0.png'" alt="Bad" data-value="0" />
<div class="o_livechat_no_feedback text-muted">
<em> I don't want to rate this conversation</em>
</div>
</div>
<div class="o_livechat_rating_reason">
<textarea id="reason" placeholder="Explain your note"></textarea>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment