diff options
Diffstat (limited to 'addons/mail/static/src/js')
| -rw-r--r-- | addons/mail/static/src/js/chatter.js | 15 | ||||
| -rw-r--r-- | addons/mail/static/src/js/composer.js | 3 |
2 files changed, 15 insertions, 3 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(); }); }); }); diff --git a/addons/mail/static/src/js/composer.js b/addons/mail/static/src/js/composer.js index b15a446d7a9..64cc48285e5 100644 --- a/addons/mail/static/src/js/composer.js +++ b/addons/mail/static/src/js/composer.js @@ -486,13 +486,10 @@ var BasicComposer = Widget.extend({ }, send_message: function () { - var $button = this.$('.o_composer_button_send'); - if (this.is_empty() || !this.do_check_attachment_upload()) { return; } - $button.prop('disabled', true); clearTimeout(this.canned_timeout); var self = this; this.preprocess_message().then(function (message) { |
