diff options
| author | Aaron Bohy <aab@odoo.com> | 2015-12-11 17:40:24 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2015-12-15 10:01:21 +0100 |
| commit | 17896a92da39d265fda7b0e2f32479a18d0b8ace (patch) | |
| tree | 361cd5a52e7b7f77ce9560cf572dafd213d9a05e /addons/mail/static | |
| parent | 1029571c35bf5372318590a439e53e3a881b2308 (diff) | |
[FIX] mail: various ui improvements/fixes
* chat windows:
- input was kicked out of the window on chrome 43
- don't animate if folded by default (e.g. after a refresh)
- width and height 100% like in the frontend
- z-index to make sure that they are over bootstrap active btn,
but below notifications, and modals
* chatter:
- internal note: send button renammed to 'Log'
- send button is the first button again
- remove annoying form view widget's tooltip
* client action: focus on composer on channel change
Diffstat (limited to 'addons/mail/static')
| -rw-r--r-- | addons/mail/static/src/js/chat_window.js | 9 | ||||
| -rw-r--r-- | addons/mail/static/src/js/chatter.js | 3 | ||||
| -rw-r--r-- | addons/mail/static/src/js/client_action.js | 3 | ||||
| -rw-r--r-- | addons/mail/static/src/js/composer.js | 1 | ||||
| -rw-r--r-- | addons/mail/static/src/less/chat_window.less | 12 | ||||
| -rw-r--r-- | addons/mail/static/src/less/client_action.less | 3 | ||||
| -rw-r--r-- | addons/mail/static/src/xml/composer.xml | 2 |
7 files changed, 26 insertions, 7 deletions
diff --git a/addons/mail/static/src/js/chat_window.js b/addons/mail/static/src/js/chat_window.js index 4edc8a23c44..ca36b430791 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 c99e958929e..94f3773258b 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 14682f49a4e..1a12ff36912 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 971c2e99c69..4112a8498cf 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 f37b66f85ff..ca2e8ca74f1 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 b23d7d373aa..408f3074311 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 d199c0d5fdf..71afe4d1695 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> |
