summaryrefslogtreecommitdiff
path: root/addons/mail/static
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2016-01-15 16:19:03 +0100
committerGéry Debongnie <ged@odoo.com>2016-01-15 16:33:33 +0100
commit59ce9a0ed94cd82679dfae8a0dd69f05dbca1e34 (patch)
tree4ec36e32e8ce1afdc506e3706704cb0b15cd9bdf /addons/mail/static
parent5a76586edec032c77edd1097edea107bdb2abc14 (diff)
[FIX] mail: composer fixes
- chatter composer did incorrectly send messages when enter is pressed - add a div around the textareas to prevent rendering issues because of flex
Diffstat (limited to 'addons/mail/static')
-rw-r--r--addons/mail/static/src/js/chatter.js4
-rw-r--r--addons/mail/static/src/js/composer.js4
-rw-r--r--addons/mail/static/src/less/client_action.less6
-rw-r--r--addons/mail/static/src/less/composer.less2
-rw-r--r--addons/mail/static/src/xml/composer.xml4
5 files changed, 14 insertions, 6 deletions
diff --git a/addons/mail/static/src/js/chatter.js b/addons/mail/static/src/js/chatter.js
index 15e51c253e2..46d5fcab8fd 100644
--- a/addons/mail/static/src/js/chatter.js
+++ b/addons/mail/static/src/js/chatter.js
@@ -467,6 +467,10 @@ var ChatterComposer = composer.BasicComposer.extend({
return $.when(this._super.apply(this, arguments), this.message_get_suggested_recipients());
},
+ should_send: function () {
+ return false;
+ },
+
preprocess_message: function () {
var self = this;
var def = $.Deferred();
diff --git a/addons/mail/static/src/js/composer.js b/addons/mail/static/src/js/composer.js
index be30588a642..dae8cdc4241 100644
--- a/addons/mail/static/src/js/composer.js
+++ b/addons/mail/static/src/js/composer.js
@@ -315,7 +315,7 @@ var BasicComposer = Widget.extend({
template: "mail.ChatComposer",
events: {
- "keydown .o_composer_input": "on_keydown",
+ "keydown .o_composer_input textarea": "on_keydown",
"keyup .o_composer_input": "on_keyup",
"change input.o_form_input_file": "on_attachment_change",
"click .o_composer_button_send": "send_message",
@@ -367,7 +367,7 @@ var BasicComposer = Widget.extend({
this.$attachment_button = this.$(".o_composer_button_add_attachment");
this.$attachments_list = this.$('.o_composer_attachments_list');
- this.$input = this.$('.o_composer_input');
+ this.$input = this.$('.o_composer_input textarea');
this.$input.focus(function () {
self.trigger('input_focused');
});
diff --git a/addons/mail/static/src/less/client_action.less b/addons/mail/static/src/less/client_action.less
index 96efc5f80b6..8d5ecccd2d3 100644
--- a/addons/mail/static/src/less/client_action.less
+++ b/addons/mail/static/src/less/client_action.less
@@ -128,9 +128,11 @@
.o_composer_input {
.o-flex(1, 1, auto);
- padding: 5px;
margin-right: 5px;
- border: none;
+ > textarea {
+ padding: 5px;
+ border: none;
+ }
}
&.o_extended_composer .o_composer_input {
margin-right: 0;
diff --git a/addons/mail/static/src/less/composer.less b/addons/mail/static/src/less/composer.less
index 6dad1dac3d2..88b44fec311 100644
--- a/addons/mail/static/src/less/composer.less
+++ b/addons/mail/static/src/less/composer.less
@@ -10,7 +10,7 @@
}
.o_composer {
- .o_composer_input {
+ .o_composer_input > textarea {
resize: none;
}
}
diff --git a/addons/mail/static/src/xml/composer.xml b/addons/mail/static/src/xml/composer.xml
index ea2bb26004a..25f9ba6bfda 100644
--- a/addons/mail/static/src/xml/composer.xml
+++ b/addons/mail/static/src/xml/composer.xml
@@ -14,7 +14,9 @@
</div>
</t>
<div t-attf-class="o_composer #{widget.extended ? 'o_extended_composer' : ''}">
- <textarea class="o_composer_input" placeholder="Write something..."/>
+ <div class="o_composer_input">
+ <textarea placeholder="Write something..."/>
+ </div>
<t t-if="!widget.extended">
<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>