summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/composer.js
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2016-12-19 09:49:33 +0100
committerNicolas Lempereur <nle@odoo.com>2017-01-02 17:37:42 +0100
commit5d0b9285449257e6878091ddead022cefda73bce (patch)
treee9a7dcf50e9871dd1ae0c066ec058379689430ab /addons/mail/static/src/js/composer.js
parent13af401bc2c4286cabc87b4c409d478350e5d6d3 (diff)
[IMP] mail: don't clear undelivered chatter message
When a message is sent on the chatter and the call fails (for example because of an internet connection failure), the message was still cleared so the content was lost. This change keep the same behavior for chat window and discuss, but change the behavior in a chatter so the message is only cleared if the rpc has passed. closes #14759 opw-696971
Diffstat (limited to 'addons/mail/static/src/js/composer.js')
-rw-r--r--addons/mail/static/src/js/composer.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/addons/mail/static/src/js/composer.js b/addons/mail/static/src/js/composer.js
index 6560e76fb13..a3b86e54c8c 100644
--- a/addons/mail/static/src/js/composer.js
+++ b/addons/mail/static/src/js/composer.js
@@ -493,16 +493,22 @@ var BasicComposer = Widget.extend({
var self = this;
this.preprocess_message().then(function (message) {
self.trigger('post_message', message);
-
- // Empty input, selected partners and attachments
- self.$input.val('');
- self.mention_manager.reset_selections();
- self.set('attachment_ids', []);
-
+ self.clear_composer_on_send();
self.$input.focus();
});
},
+ clear_composer: function() {
+ // Empty input, selected partners and attachments
+ this.$input.val('');
+ this.mention_manager.reset_selections();
+ this.set('attachment_ids', []);
+ },
+
+ clear_composer_on_send: function() {
+ this.clear_composer();
+ },
+
// Events
on_click_add_attachment: function () {
this.$('input.o_form_input_file').click();