[IMP] css: global mail compose button is beautifuller and better integrated
authorFrédéric van der Essen <fva@openerp.com>
Mon, 29 Oct 2012 16:52:11 +0000 (17:52 +0100)
committerFrédéric van der Essen <fva@openerp.com>
Mon, 29 Oct 2012 16:52:11 +0000 (17:52 +0100)
bzr revid: fva@openerp.com-20121029165211-dzd1najj6btorzi9

addons/mail/static/src/css/mail.css
addons/mail/static/src/js/mail.js
addons/mail/static/src/xml/mail.xml

index 86fcd78..6de8ca5 100644 (file)
@@ -1,3 +1,30 @@
+/* ------------ 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;
+}
+.openerp .oe_topbar_item.oe_topbar_compose_full_email button{
+    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 *{
 }
 .openerp .oe_mail .oe_msg .oe_msg_content textarea{
     width: 100%;
-    height: 32px;
+    height: 64px;
     margin: 0px;
     padding: 0px;
     resize: vertical;
index 9133e5d..258f85f 100644 (file)
@@ -1681,13 +1681,16 @@ openerp.mail = function (session) {
         },
 
     });
-
-    session.web.UserMenu = session.web.UserMenu.extend({
-        start: function (parent, params) {
-            var render = new session.web.ComposeMessageTopButton();
-            render.insertAfter(this.$el);
-            this._super(parent, params);
-        }
+    
+    session.web.UserMenu.include({
+        do_update: function(){
+            var self = this;
+            this._super.apply(this, arguments);
+            this.update_promise.then(function() {
+                var mail_button = new session.web.ComposeMessageTopButton();
+                mail_button.appendTo(session.webclient.$el.find('.oe_systray'));
+            });
+        },
     });
 
 };
index caa85cd..a34538e 100644 (file)
         render of the button on the user bar for open wizard compose message
         -->
     <t t-name="mail.compose_message.button_top_bar">
-        <div class="oe_topbar_compose_full_email">
-            <!-- <button class="oe_button oe_highlight">Write an email</button> -->
+        <div title='Compose new Message' class="oe_topbar_item oe_topbar_compose_full_email">
+            <button class="oe_e">%</button>
         </div>
     </t>