[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
This commit is contained in:
Géry Debongnie
2016-01-15 16:33:33 +01:00
parent 5a76586ede
commit 59ce9a0ed9
5 changed files with 14 additions and 6 deletions
+4
View File
@@ -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();
+2 -2
View File
@@ -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');
});
@@ -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;
+1 -1
View File
@@ -10,7 +10,7 @@
}
.o_composer {
.o_composer_input {
.o_composer_input > textarea {
resize: none;
}
}
+3 -1
View File
@@ -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>