diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-11-12 13:06:48 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-11-12 13:06:48 +0100 |
| commit | 99d0e1b80e5b2d5eb59b96c6ce1bf246f8df2326 (patch) | |
| tree | 6c53282f8a22e9b59d83762ebe057173172c5f63 /addons/mail/static/src | |
| parent | 4d53266e236d1816e45b13aa50bcafb1bab2bc8c (diff) | |
| parent | a403155dec769418ede3c9128a887847f97a956f (diff) | |
[MERGE] forward port branch 12.0 up to a403155dec7
Diffstat (limited to 'addons/mail/static/src')
| -rw-r--r-- | addons/mail/static/src/js/chatter.js | 15 | ||||
| -rw-r--r-- | addons/mail/static/src/js/composers/basic_composer.js | 1 | ||||
| -rw-r--r-- | addons/mail/static/src/js/composers/chatter_composer.js | 2 | ||||
| -rw-r--r-- | addons/mail/static/src/js/followers.js | 4 | ||||
| -rw-r--r-- | addons/mail/static/src/js/thread_widget.js | 4 |
5 files changed, 21 insertions, 5 deletions
diff --git a/addons/mail/static/src/js/chatter.js b/addons/mail/static/src/js/chatter.js index 2f2e1a0e770..000353d1219 100644 --- a/addons/mail/static/src/js/chatter.js +++ b/addons/mail/static/src/js/chatter.js @@ -183,6 +183,12 @@ var Chatter = Widget.extend({ this.$('.btn').prop('disabled', true); // disable buttons }, /** + * @private + */ + _disableComposer: function () { + this.$(".o_composer_button_send").prop('disabled', true); + }, + /** * Discard changes on the record. * * @private @@ -222,6 +228,12 @@ var Chatter = Widget.extend({ /** * @private */ + _enableComposer: function () { + this.$(".o_composer_button_send").prop('disabled', false); + }, + /** + * @private + */ _openAttachments: function () { var self = this; this.fields.attachments = new AttachmentBox(this, this.record); @@ -268,6 +280,7 @@ var Chatter = Widget.extend({ } self._composer.on('post_message', self, function (messageData) { self._discardOnReload(messageData).then(function () { + self._disableComposer(); self.fields.thread.postMessage(messageData).then(function () { self._closeComposer(true); if (self._reloadAfterPost(messageData)) { @@ -275,6 +288,8 @@ var Chatter = Widget.extend({ } else if (messageData.attachment_ids.length) { self.trigger_up('reload', {fieldNames: ['message_attachment_count']}); } + }).fail(function () { + self._enableComposer(); }); }); }); diff --git a/addons/mail/static/src/js/composers/basic_composer.js b/addons/mail/static/src/js/composers/basic_composer.js index 0e4d62232e2..a6cdb39e2de 100644 --- a/addons/mail/static/src/js/composers/basic_composer.js +++ b/addons/mail/static/src/js/composers/basic_composer.js @@ -390,7 +390,6 @@ var BasicComposer = Widget.extend({ return; } - this.$(".o_composer_button_send").prop("disabled", true); clearTimeout(this._cannedTimeout); var self = this; this._preprocessMessage().then(function (message) { diff --git a/addons/mail/static/src/js/composers/chatter_composer.js b/addons/mail/static/src/js/composers/chatter_composer.js index d1a990b31e4..cda91eab205 100644 --- a/addons/mail/static/src/js/composers/chatter_composer.js +++ b/addons/mail/static/src/js/composers/chatter_composer.js @@ -45,7 +45,7 @@ var ChatterComposer = BasicComposer.extend({ * * @override */ - clearComposerOnSend: function () {}, + _clearComposerOnSend: function () {}, //-------------------------------------------------------------------------- // Private diff --git a/addons/mail/static/src/js/followers.js b/addons/mail/static/src/js/followers.js index 2b440aa3477..0a760516607 100644 --- a/addons/mail/static/src/js/followers.js +++ b/addons/mail/static/src/js/followers.js @@ -28,7 +28,9 @@ var Followers = AbstractField.extend({ 'click .o_remove_follower': '_onRemoveFollower', 'click .o_mail_redirect': '_onRedirect', }, - supportedFieldTypes: ['one2many'], + // this widget only supports one2many but is not generic enough to claim + // that it supports all one2many fields + // supportedFieldTypes: ['one2many'], // inherited init: function (parent, name, record, options) { diff --git a/addons/mail/static/src/js/thread_widget.js b/addons/mail/static/src/js/thread_widget.js index aff6b27bfdd..e6da87c6dba 100644 --- a/addons/mail/static/src/js/thread_widget.js +++ b/addons/mail/static/src/js/thread_widget.js @@ -284,12 +284,12 @@ var ThreadWidget = Widget.extend({ /** * Scrolls the thread to a given message * - * @param {integer} options.messageID the ID of the message to scroll to + * @param {integer} options.msgID the ID of the message to scroll to * @param {integer} [options.duration] * @param {boolean} [options.onlyIfNecessary] */ scrollToMessage: function (options) { - var $target = this.$('.o_thread_message[data-message-id="' + options.messageID + '"]'); + var $target = this.$('.o_thread_message[data-message-id="' + options.msgID + '"]'); if (options.onlyIfNecessary) { var delta = $target.parent().height() - $target.height(); var offset = delta < 0 ? |
