From 8667b2a57d744783d54c5afdc87b5f0f659802fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Maes?= Date: Wed, 24 Dec 2014 15:41:41 +0100 Subject: [PATCH] [FIX] mail : fix style (css, js and xml) of topbar button of mail.compose.message --- addons/mail/static/src/css/mail.css | 24 ++---------------------- addons/mail/static/src/js/mail.js | 14 ++++++-------- addons/mail/static/src/xml/mail.xml | 6 ++++-- 3 files changed, 12 insertions(+), 32 deletions(-) diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index 75dfb55568a..080736bdbf4 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -1,29 +1,9 @@ /* ------------ TOPBAR MAIL BUTTON --------------- */ - -/* FIXME this css is not very pretty because it uses a - * 'button' element wich comes with a lot of inappropriate - * styling. Entypo is also a headache to center properly - * */ -.openerp .oe_topbar_item.oe_topbar_compose_full_email{ - padding: 0px; - width: 32px; - height: 32px; -} -.oe_topbar_item.oe_topbar_compose_full_email button{ +.oe_topbar_item.oe_topbar_compose_full_email *{ position: relative; - top: -3px; /* centering entypo ... urgh */ - box-sizing: border-box; - border: none; - box-shadow: none; color: white; - background: none; - text-shadow: 0px 1px 2px black; - width: 32px; - height: 32px; - padding: 0px; - margin: 0px - border-radius: 0px; } + /* ------------ MAIL WIDGET --------------- */ .openerp .oe_mail, .openerp .oe_mail *{ -webkit-box-sizing: border-box; diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index ca5ce40c37e..2cdfcdff4ac 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -2045,6 +2045,7 @@ openerp.mail = function (session) { */ openerp.mail.suggestions(session, mail); // import suggestion.js (suggestion widget) + /** * ------------------------------------------------------------ * UserMenu @@ -2053,15 +2054,12 @@ openerp.mail = function (session) { * Add a link on the top user bar for write a full mail */ session.web.ComposeMessageTopButton = session.web.Widget.extend({ - template:'mail.ComposeMessageTopButton', - - start: function () { - this.$('button').on('click', this.on_compose_message ); - this._super(); + template:'mail.compose_message_top_button', + events: { + "click": "on_compose_message", }, - - on_compose_message: function (event) { - event.stopPropagation(); + on_compose_message: function (ev) { + ev.preventDefault(); var action = { type: 'ir.actions.act_window', res_model: 'mail.compose.message', diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index 6490b09e0fa..72313d27dec 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -325,9 +325,11 @@ mail.compose_message.button_top_bar render of the button on the user bar for open wizard compose message --> - +
  • - + + +