summaryrefslogtreecommitdiff
path: root/addons/mail/static/src
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2012-06-18 17:06:08 +0200
committerThibault Delavallée <tde@openerp.com>2012-06-18 17:06:08 +0200
commit73dc2aee923b8056478bb5b2c72be8baf51cddb2 (patch)
treece3810774b53b8b379f4d1daad0dd62bcf03b705 /addons/mail/static/src
parent0d536b43469ecd35c700a646a430e26fa4a242bf (diff)
[IMP] mail.compose.message widget: first integration in chatter.
bzr revid: tde@openerp.com-20120618150608-0go3xc0l3yil14ps
Diffstat (limited to 'addons/mail/static/src')
-rw-r--r--addons/mail/static/src/js/mail.js16
-rw-r--r--addons/mail/static/src/xml/mail.xml11
2 files changed, 19 insertions, 8 deletions
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index ba5315ea544..895499abea8 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -43,6 +43,8 @@ openerp.mail = function(session) {
init: function(parent, params) {
this._super(parent);
+ this.params = params || {};
+ this.params.extended_mode = params.extended_mode || false;
this.ds_compose = new session.web.DataSetSearch(this, 'mail.compose.message');
this.form_view = new session.web.FormView(this, this.ds_compose, false, {
action_buttons: false,
@@ -59,7 +61,9 @@ openerp.mail = function(session) {
start: function(parent, params) {
var self = this;
this._super.apply(this, arguments);
- var main_node = this.$element;
+ console.log(this.$element);
+ var main_node = this.$element.find('div.oe_mail_msg_content');
+ console.log(main_node);
return $.when(this.form_view.appendTo(main_node)).pipe(function() {
self.bind_events();
@@ -76,9 +80,11 @@ openerp.mail = function(session) {
// advanced options for writing a message
this.$element.find('a.mail_compose_message_toggle').click(function (event) {
event.preventDefault();
- self.$element.find('span.mail_compose_message_subject').toggle();
- self.$element.find('div.mail_compose_message_body_html').toggle();
- self.$element.find('div.mail_compose_message_partner_ids').toggle();
+ self.$element.find('span.oe_mail_compose_message_subject').toggleClass('oe_mail_compose_message_invisible');
+ self.$element.find('div.oe_mail_compose_message_body_text').toggleClass('oe_mail_compose_message_invisible');
+ self.$element.find('div.oe_mail_compose_message_body_html').toggleClass('oe_mail_compose_message_invisible');
+ self.$element.find('div.oe_mail_compose_message_partner_ids').toggleClass('oe_mail_compose_message_invisible');
+
});
},
@@ -167,7 +173,7 @@ openerp.mail = function(session) {
$.when(display_done).then(this.proxy('do_customize_display'));
// add message composition form view
- this.compose_message = new mail.ComposeMessage();
+ this.compose_message = new mail.ComposeMessage(this, {'extended_mode': false});
var compose_done = this.compose_message.appendTo(this.$element.find('div.oe_mail_thread_act'));
return display_done && compose_done;
diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml
index b0fa456d36c..8f4a74e6fad 100644
--- a/addons/mail/static/src/xml/mail.xml
+++ b/addons/mail/static/src/xml/mail.xml
@@ -68,14 +68,18 @@
an e-mail.
-->
<t t-name="mail.compose_message">
- <div class="oe_mail_compose_message">
- <!-- contains the composition form -->
+ <div>
+ <img class="oe_mail_msg_image oe_left" alt="User img"/>
+ <div class="oe_mail_msg_content">
+ <!-- contains the composition form -->
+ </div>
+ <div class="oe_clear"/>
</div>
- <div class="oe_clear"/>
</t>
<ul t-name="Thread" class="oe_mail oe_mail_thread">
<div class="oe_mail_thread_act">
+<!--
<img class="oe_mail_msg_image oe_left" alt="User img"/>
<div class="oe_mail_msg_content">
<textarea class="oe_mail oe_mail_action_textarea" placeholder="Add your comment here..." onfocus="this.value = '';"/>
@@ -83,6 +87,7 @@
<a href="#" class="oe_mail_compose oe_right">Send an e-mail
<img src='/mail/static/src/img/email_icon.png' alt='Send an e-mail'/>
</a>
+-->
</div>
<div class="oe_mail_thread_display"></div>
<div class="oe_mail_thread_more">