summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/chatter.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/mail/static/src/js/chatter.js')
-rw-r--r--addons/mail/static/src/js/chatter.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/chatter.js b/addons/mail/static/src/js/chatter.js
index 63948b8429a..e691ec98c73 100644
--- a/addons/mail/static/src/js/chatter.js
+++ b/addons/mail/static/src/js/chatter.js
@@ -156,6 +156,18 @@ var Chatter = Widget.extend({
}
},
/**
+ * @private
+ */
+ _disableComposer: function () {
+ this.$(".o_composer_button_send").prop('disabled', true);
+ },
+ /**
+ * @private
+ */
+ _enableComposer: function () {
+ this.$(".o_composer_button_send").prop('disabled', false);
+ },
+ /**
* Discard changes on the record.
*
* @private
@@ -231,12 +243,15 @@ var Chatter = Widget.extend({
self.composer.focus();
}
self.composer.on('post_message', self, function (message) {
+ self._disableComposer();
self._discardOnReload(message).then(function () {
self.fields.thread.postMessage(message).then(function () {
self._closeComposer(true);
if (self._reloadAfterPost(message)) {
self.trigger_up('reload');
}
+ }).fail(function () {
+ self._enableComposer();
});
});
});