diff --git a/addons/im_livechat/static/src/less/im_livechat.less b/addons/im_livechat/static/src/less/im_livechat.less index ce1a25a02fc6218766d0aca0daffe4388f3b0d58..c0940977da29a786a63e23f7da177e4081619a62 100644 --- a/addons/im_livechat/static/src/less/im_livechat.less +++ b/addons/im_livechat/static/src/less/im_livechat.less @@ -19,10 +19,7 @@ } .o_chat_window { - display: flex; - max-height: 100%; - max-width: 100%; - z-index: 1000; // to go over the navbar + z-index: 1002; // to go over the navbar .o_thread_date_separator { display: none; } diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index 9f9e7294146d603d61012157e306c046ece6c8be..ce91a0d81fe36f946d9844824fff9a5685e38945 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -95,8 +95,7 @@ class MailThread(models.AbstractModel): compute='_get_followers', search='_search_follower_channels') message_ids = fields.One2many( 'mail.message', 'res_id', string='Messages', - domain=lambda self: [('model', '=', self._name)], auto_join=True, - help="Messages and communication history") + domain=lambda self: [('model', '=', self._name)], auto_join=True) message_last_post = fields.Datetime('Last Message Date', help='Date of the last message posted on the record.') message_unread = fields.Boolean( 'Unread Messages', compute='_get_message_unread', diff --git a/addons/mail/static/src/js/chat_window.js b/addons/mail/static/src/js/chat_window.js index 4edc8a23c44b8b0e16f5e9e06ee28617ac5b3625..ca36b4307911a53c2eef8275cc3602aba00585aa 100644 --- a/addons/mail/static/src/js/chat_window.js +++ b/addons/mail/static/src/js/chat_window.js @@ -8,6 +8,9 @@ var Widget = require('web.Widget'); var _t = core._t; +var HEIGHT_OPEN = '400px'; +var HEIGHT_FOLDED = '28px'; + return Widget.extend({ template: "mail.ChatWindow", events: { @@ -40,7 +43,9 @@ return Widget.extend({ this.thread.on('redirect_to_channel', null, this.trigger.bind(this, 'redirect_to_channel')); this.thread.on('redirect', null, this.trigger.bind(this, 'redirect')); - this.fold(); + if (this.folded) { + this.$el.css('height', HEIGHT_FOLDED); + } var def = this.thread.appendTo(this.$content); return $.when(this._super(), def); }, @@ -63,7 +68,7 @@ return Widget.extend({ fold: function () { this.update_header(); this.$el.animate({ - height: this.folded ? "28px" : "400px" + height: this.folded ? HEIGHT_FOLDED : HEIGHT_OPEN }); }, toggle_fold: function (fold) { diff --git a/addons/mail/static/src/js/chatter.js b/addons/mail/static/src/js/chatter.js index c99e958929edde397f04dd458d467c8622e71d03..94f3773258ba4239923fbe76f9f3b5d7fe95f25b 100644 --- a/addons/mail/static/src/js/chatter.js +++ b/addons/mail/static/src/js/chatter.js @@ -445,6 +445,9 @@ var ChatterComposer = ChatComposer.extend({ is_log: false, internal_subtypes: [], }); + if (this.options.is_log) { + this.options.send_text = _('Log'); + } this.events = _.extend(this.events, { 'click .o_composer_button_full_composer': 'on_open_full_composer', }); diff --git a/addons/mail/static/src/js/client_action.js b/addons/mail/static/src/js/client_action.js index 14682f49a4edac6c780e0c0d773b34cd77bbaa2a..1a12ff36912f6b8d1a9a01ed089fb385f727ce60 100644 --- a/addons/mail/static/src/js/client_action.js +++ b/addons/mail/static/src/js/client_action.js @@ -382,6 +382,8 @@ var ChatAction = Widget.extend(ControlPanelMixin, { self.thread.scroll_to({offset: new_channel_scrolltop}); } + // Update control panel before focusing the composer, otherwise focus is on the searchview + self.update_cp(); if (!config.device.touch) { self.composer.focus(); } @@ -389,7 +391,6 @@ var ChatAction = Widget.extend(ControlPanelMixin, { self.$('.o_mail_chat_sidebar').hide(); } - self.update_cp(); self.action_manager.do_push_state({ action: self.action.id, active_id: self.channel.id, diff --git a/addons/mail/static/src/js/composer.js b/addons/mail/static/src/js/composer.js index 971c2e99c69dd9ba56311cc67e912d76e5c4cc32..4112a8498cf2e3944432db0f1fdbcc75bdbb4c97 100644 --- a/addons/mail/static/src/js/composer.js +++ b/addons/mail/static/src/js/composer.js @@ -330,6 +330,7 @@ var Composer = Widget.extend({ input_max_height: 150, input_min_height: 28, mention_fetch_limit: 8, + send_text: _('Send'), }); this.context = this.options.context; diff --git a/addons/mail/static/src/less/chat_window.less b/addons/mail/static/src/less/chat_window.less index f37b66f85ffc0f769a46120a02b5bd600ff543df..ca2e8ca74f1eaae69258a076b91b1f6e686caf07 100644 --- a/addons/mail/static/src/less/chat_window.less +++ b/addons/mail/static/src/less/chat_window.less @@ -5,11 +5,14 @@ .o-flex-flow(column, nowrap); position: fixed; width: 300px; + max-width: 100%; height: 400px; + max-height: 100%; font-size: 12px; background-color: @o-chat-window-bg; border: 1px solid gray; border-radius: 3px; + z-index: 2; @media (max-width: @screen-xs-max) { display:none; @@ -56,8 +59,11 @@ } } - .o_chat_input > input { - padding: 5px; - width: 100%; + .o_chat_input { + .o-flex(0, 0, auto); + > input { + padding: 5px; + width: 100%; + } } } diff --git a/addons/mail/static/src/less/client_action.less b/addons/mail/static/src/less/client_action.less index b23d7d373aa24aabf7ed2efea2e975c961d879a4..408f3074311dc04fd7a200fbe70bacc6f1bee40b 100644 --- a/addons/mail/static/src/less/client_action.less +++ b/addons/mail/static/src/less/client_action.less @@ -106,6 +106,9 @@ .o_composer_buttons { .o-flex(0, 0, auto); + .o_composer_button_send { + float: right; + } } } } diff --git a/addons/mail/static/src/xml/composer.xml b/addons/mail/static/src/xml/composer.xml index d199c0d5fdf25abe87ce1c47b2470ddf8f38c3c6..71afe4d169579ea83b5c38e34edf2f96de80c062 100644 --- a/addons/mail/static/src/xml/composer.xml +++ b/addons/mail/static/src/xml/composer.xml @@ -6,9 +6,9 @@ <div class="o_composer"> <textarea class="o_composer_input" placeholder="Write something..."/> <div class="btn-group o_composer_buttons"> + <button class="btn btn-sm btn-primary o_composer_button_send" type="button"><t t-esc="widget.options.send_text"/></button> <button class="btn btn-sm btn-icon fa fa-smile-o o_composer_button_emoji" type="button" data-toggle="popover"/> <button class="btn btn-sm btn-icon fa fa-paperclip o_composer_button_add_attachment" type="button"/> - <button class="btn btn-sm btn-primary o_composer_button_send" type="button">Send</button> </div> </div>