From 3b1478bf57f3da03e6a992e2d2c9b8df84b85c12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Wed, 7 Nov 2012 12:44:13 +0100 Subject: [PATCH] [IMP] mail: js dom bindings for the attachments bzr revid: fva@openerp.com-20121107114413-399b2q2b5ziurxvp --- addons/mail/static/src/css/mail.css | 5 +++++ addons/mail/static/src/js/mail.js | 7 ++++++- addons/mail/static/src/xml/mail.xml | 10 ++++++---- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index a1a9acd0a73..e43b7d33755 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -211,9 +211,13 @@ /* --------------------- ATTACHMENTS --------------------- */ .openerp .oe_mail .oe_msg_attachment_list{ + display: none; margin-top: 12px; margin-bottom: 12px; } +.openerp .oe_mail .oe_msg_composer .oe_msg_attachment_list{ + display: block; +} .openerp .oe_mail .oe_attachment{ display: inline-block; width: 100px; @@ -289,6 +293,7 @@ margin: 0px; left: 0px; right: 0px; + max-height: 64px; background: rgba(0,0,0,0.8); color: white; border-top-left-radius: 0px; diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index e5529065aa6..46f8553f666 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -363,7 +363,7 @@ openerp.mail = function (session) { display_attachments: function () { this.$(".oe_msg_attachment_list").html( session.web.qweb.render('mail.thread.message.attachments', {'widget': this}) ); // event: delete an attachment - this.$(".oe_msg_attachment_list").on('click', '.oe_mail_attachment_delete', this.on_attachment_delete); + this.$(".oe_msg_attachment_list").on('click', '.oe_delete', this.on_attachment_delete); }, /* when a user click on the upload button, send file read on_attachment_loaded @@ -734,6 +734,11 @@ openerp.mail = function (session) { this.$el.on('click', '.oe_msg_vote', this.on_vote); // event: click on 'starred/favorite' button this.$el.on('click', '.oe_star', this.on_star); + + this.$el.on('click', '.oe_view_attachments', function(){ + console.log('toggle'); + self.$('.oe_msg_attachment_list').toggle(200); + }); }, /* Call the on_compose_message on the thread of this message. */ diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index 3451566db46..02c29a3f1c2 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -73,7 +73,7 @@
- +
[
@@ -83,7 +83,7 @@
- +
[
@@ -218,11 +218,13 @@ • - - • + + • + 1 Attachment Attachments + •