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

[FIX] mail: trim message and no empty message

Trim message as in Discuss and do not send empty messages
parent 149aa2ff
No related branches found
No related tags found
No related merge requests found
......@@ -77,13 +77,16 @@ return Widget.extend({
on_keydown: function (event) {
// ENTER key (avoid requiring jquery ui for external livechat)
if (event.which === 13) {
var content = _.str.trim(this.$input.val());
var message = {
content: this.$input.val(),
content: content,
attachment_ids: [],
partner_ids: [],
};
this.$input.val('');
this.trigger('post_message', message, this.channel_id);
if (content) {
this.trigger('post_message', message, this.channel_id);
}
}
},
on_click_close: function (event) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment