[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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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',
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,6 +106,9 @@
|
||||
|
||||
.o_composer_buttons {
|
||||
.o-flex(0, 0, auto);
|
||||
.o_composer_button_send {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user