[IMP] mail: client action: focus on composer when opening a channel
Disable this feature on mobile as we don't want the mobile composer to open each time we switch from an channel to an other.
This commit is contained in:
@@ -5,6 +5,7 @@ var chat_manager = require('mail.chat_manager');
|
||||
var ChatComposer = require('mail.ChatComposer');
|
||||
var ChatThread = require('mail.ChatThread');
|
||||
|
||||
var config = require('web.config');
|
||||
var ControlPanelMixin = require('web.ControlPanelMixin');
|
||||
var core = require('web.core');
|
||||
var data = require('web.data');
|
||||
@@ -314,6 +315,9 @@ var ChatAction = Widget.extend(ControlPanelMixin, {
|
||||
|
||||
return this.fetch_and_render_thread().then(function () {
|
||||
self.thread.scroll_to({offset: new_channel_scrolltop});
|
||||
if (!config.device.touch) {
|
||||
self.composer.focus();
|
||||
}
|
||||
self.action_manager.do_push_state({
|
||||
action: self.action.id,
|
||||
active_id: self.channel_id,
|
||||
|
||||
@@ -479,6 +479,9 @@ var Composer = Widget.extend({
|
||||
is_empty: function () {
|
||||
return !this.$input.val().trim() && !this.$('.o_attachments').children().length;
|
||||
},
|
||||
focus: function () {
|
||||
this.$input.focus();
|
||||
},
|
||||
});
|
||||
|
||||
return Composer;
|
||||
|
||||
Reference in New Issue
Block a user