[FIX] im_livechat: close window

If the user clicks twice on the 'x', the chat window is closed
This commit is contained in:
Nicolas Martinelli
2015-12-11 10:33:27 +01:00
parent df0c0c85f1
commit 149aa2ffc1
@@ -102,7 +102,8 @@ var LivechatButton = Widget.extend({
self.$el.hide();
});
this.chat_window.on("close_chat_session", this, function () {
if (this.messages.length > 1) {
var input_disabled = this.chat_window.$(".o_chat_input input").prop('disabled')
if (this.messages.length > 1 && !input_disabled) {
this.ask_feedback();
} else {
this.close_chat();